ByteCount.H File Reference

#include "Util/sformat.H"
#include <string>
Include dependency graph for ByteCount.H:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  ByteCount
 A class to handle parsing + converting byte counts. More...

Functions

std::string convertToString (const ByteCount &val)
 ByteCount overload: format is "<int>".
void convertFromString (const std::string &str, ByteCount &val)
 ByteCount overload: format is "<float>[<B|KiB|MiB|GiB>]".

Detailed Description

A class to handle byte counts, parsing them from strings, and converting between bytes, kibibytes, mebibytes, etc.

Definition in file ByteCount.H.


Function Documentation

void convertFromString ( const std::string str,
ByteCount val 
) [inline]

ByteCount overload: format is "<float>[<B|KiB|MiB|GiB>]".

Definition at line 130 of file ByteCount.H.

std::string convertToString ( const ByteCount val  )  [inline]

ByteCount overload: format is "<int>".

Note that we don't do any abbreviations to KiB, Mib, GiB, etc. on output, since that would involve a conversion to floating point that might result in data loss after a conversion to string and back. If you want such an abbreviated string, you can use ByteCount::prettyPrint().

Definition at line 124 of file ByteCount.H.

References ByteCount::bytes(), and sformat().

Generated on Sun May 8 08:42:52 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3