168 : FormatString(formatStr)
179 FormatString(other.FormatString)
184 std::string FormatString;
190 const std::string & GetFormat(
void)
const
245 OutputStream << text;
251 template<
class _argType>
255 if (NextFormatTextPosition == 0)
258 AdvanceToNextFormat();
276 if (NextFormatTextPosition == 0)
279 AdvanceToNextFormat();
289 if (NextFormatTextPosition == 0)
292 AdvanceToNextFormat();
307 #if CISST_OSTREAM_CAN_CAST_TO_VOID_PTR
308 inline operator void *(void)
310 return (
void *)(OutputStream);
312 #elif CISST_OSTREAM_CAN_CAST_TO_INT
313 inline operator bool (
void)
318 inline operator bool(
void)
320 return OutputStream.good();
327 enum {BUFFER_SIZE = 256};
333 void DumpUntilPercent(
void);
337 void ProcessPercent(
void);
340 std::ostream & OutputStream;
346 char * NextFormatTextPosition;
351 char NextFormatTextCharacter;
355 char * FormatSequence;
359 char NextTypeIdCharacter;
366 void AdvanceToNextFormat(
void)
412 return IntegerTypeIds;
421 return IntegerTypeIds;
430 return IntegerTypeIds;
439 return IntegerTypeIds;
450 template<
typename _outputType>
453 const char * formatCharsForData = TypeIdString(data);
454 const bool result = this->NextTypeIdCharIsOneOf(formatCharsForData);
464 bool NextTypeIdCharIsOneOf(
const char * typeIdCharset)
const;
468 NextFormatTextPosition = 0;
476 return FormatSequence;
482 return NextTypeIdCharacter;
502 #endif // _cmnPrintf_h
#define CISST_EXPORT
Definition: cmnExportMacros.h:50
const char * GetNextFormatSequence(void) const
Definition: cmnPrintf.h:474
static const char * TypeIdString(unsigned long CMN_UNUSED(value))
Definition: cmnPrintf.h:437
Portability across compilers and operating systems tools.
cmnPrintfParser operator<<(std::ostream &outputStream, const cmnPrintf &formatStr)
Definition: cmnPrintf.h:496
#define CMN_UNUSED(argument)
Definition: cmnPortability.h:479
bool MatchOutputWithFormatChar(const _outputType &data)
Definition: cmnPrintf.h:451
static const char * StringTypeIds
Definition: cmnPrintf.h:386
static const char * TypeIdString(long CMN_UNUSED(value))
Definition: cmnPrintf.h:428
void SuspendOutput(void)
Definition: cmnPrintf.h:466
cmnPrintf(const std::string &formatStr)
Definition: cmnPrintf.h:167
cmnPrintf(const cmnPrintf &other)
Definition: cmnPrintf.h:178
Macros to export the symbols of cisstCommon (in a Dll).
static const char * TypeIdString(unsigned int CMN_UNUSED(value))
Definition: cmnPrintf.h:419
char GetNextTypeIdCharacter(void) const
Definition: cmnPrintf.h:480
printf-like formatted output for streams
Definition: cmnPrintf.h:161
static const char * FloatTypeIds
Definition: cmnPrintf.h:383
static const char * TypeIdString(double CMN_UNUSED(value))
Definition: cmnPrintf.h:392
CISST_EXPORT bool cmnTypePrintf(cmnPrintfParser &parser, const int number)
static const char * TypeIdCharset
Definition: cmnPrintf.h:377
void RawOutput(const char *text)
Definition: cmnPrintf.h:243
static const char * IntegerTypeIds
Definition: cmnPrintf.h:380
~cmnPrintf()
Definition: cmnPrintf.h:172
static const char * TypeIdString(float CMN_UNUSED(value))
Definition: cmnPrintf.h:401
Parser for cmnPrintf.
Definition: cmnPrintf.h:227
static const char * TypeIdString(int CMN_UNUSED(value))
Definition: cmnPrintf.h:410