165 : FormatString(formatStr)
176 FormatString(other.FormatString)
181 std::string FormatString;
183 friend class cmnPrintfParser;
187 const std::string & GetFormat(
void)
const
240 void RawOutput(
const char * text)
242 OutputStream << text;
248 template<
class _argType>
252 if (NextFormatTextPosition == 0)
255 AdvanceToNextFormat();
273 if (NextFormatTextPosition == 0)
276 AdvanceToNextFormat();
286 if (NextFormatTextPosition == 0)
289 AdvanceToNextFormat();
296 enum {BUFFER_SIZE = 256};
302 void DumpUntilPercent(
void);
306 void ProcessPercent(
void);
309 std::ostream & OutputStream;
315 char * NextFormatTextPosition;
320 char NextFormatTextCharacter;
324 char * FormatSequence;
328 char NextTypeIdCharacter;
335 inline void AdvanceToNextFormat(
void)
346 static const char * TypeIdCharset;
349 static const char * IntegerTypeIds;
352 static const char * FloatTypeIds;
355 static const char * StringTypeIds;
361 static inline const char * TypeIdString(
double CMN_UNUSED(value))
370 static inline const char * TypeIdString(
float CMN_UNUSED(value))
379 static inline const char * TypeIdString(
int CMN_UNUSED(value))
381 return IntegerTypeIds;
388 static inline const char * TypeIdString(
unsigned int CMN_UNUSED(value))
390 return IntegerTypeIds;
397 static inline const char * TypeIdString(
long CMN_UNUSED(value))
399 return IntegerTypeIds;
406 static inline const char * TypeIdString(
unsigned long CMN_UNUSED(value))
408 return IntegerTypeIds;
419 template<
typename _outputType>
420 bool MatchOutputWithFormatChar(
const _outputType & data)
422 const char * formatCharsForData = TypeIdString(data);
423 const bool result = this->NextTypeIdCharIsOneOf(formatCharsForData);
433 bool NextTypeIdCharIsOneOf(
const char * typeIdCharset)
const;
435 void SuspendOutput(
void)
437 NextFormatTextPosition = 0;
443 const char * GetNextFormatSequence(
void)
const
445 return FormatSequence;
449 char GetNextTypeIdCharacter(
void)
const
451 return NextTypeIdCharacter;
464inline cmnPrintfParser
465operator << (std::ostream & outputStream,
const cmnPrintf & formatStr)
467 return cmnPrintfParser(outputStream, formatStr);
std::ostream & operator<<(std::ostream &output, const cmnClassRegister &classRegister)
Definition cmnClassRegister.h:349
Macros to export the symbols of cisstCommon (in a Dll).
#define CISST_EXPORT
Definition cmnExportMacros.h:50
Portability across compilers and operating systems tools.
#define CMN_UNUSED(argument)
Definition cmnPortability.h:497
friend class cmnPrintfParser
Definition cmnPrintf.h:183
CISST_EXPORT bool cmnTypePrintf(cmnPrintfParser &parser, const int number)
cmnPrintf(const std::string &formatStr)
printf-like formatted output for streams
Definition cmnPrintf.h:164