Strutil Namespace Reference

String-related utilities. More...

Classes

class  StringHash
class  StringEqual

Functions

std::string DLLPUBLIC format (const char *fmt,...) OPENIMAGEIO_PRINTF_ARGS(1
std::string DLLPUBLIC
std::string DLLPUBLIC 
vformat (const char *fmt, va_list ap) OPENIMAGEIO_PRINTF_ARGS(1
std::string DLLPUBLIC
std::string DLLPUBLIC
std::string DLLPUBLIC 
memformat (off_t bytes, int digits=3)
std::string DLLPUBLIC timeintervalformat (double secs, int digits=1)
unsigned int strhash (const char *s)

Detailed Description

String-related utilities.


Function Documentation

std::string DLLPUBLIC Strutil::format ( const char *  fmt,
  ... 
)

Return a std::string formatted from printf-like arguments.

std::string DLLPUBLIC std::string DLLPUBLIC std::string DLLPUBLIC Strutil::memformat ( off_t  bytes,
int  digits = 3 
)

Return a string expressing a number of bytes, in human readable form.

  • memformat(153) -> "153 B"
  • memformat(15300) -> "14.9 KB"
  • memformat(15300000) -> "14.6 MB"
  • memformat(15300000000LL) -> "14.2 GB"
unsigned int Strutil::strhash ( const char *  s  )  [inline]

Beautiful little string hasher from Aho, Sethi, and Ullman's 1986 Dragon compiler book. This depends on sizeof(unsigned int) == 4.

std::string DLLPUBLIC Strutil::timeintervalformat ( double  secs,
int  digits = 1 
)

Return a string expressing an elapsed time, in human readable form. e.g. "0:35.2"

std::string DLLPUBLIC std::string DLLPUBLIC Strutil::vformat ( const char *  fmt,
va_list  ap 
)

Return a std::string formatted from printf-like arguments -- passed already as a va_list.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on Tue Oct 27 06:30:41 2009 for OpenImageIO by  doxygen 1.6.1