Fairport  v1.0.38
Util Layer
+ Collaboration diagram for Util Layer:

Classes

class  fairport::file
 A generic class to read and write to a file. More...

Modules

 BTree
 Exceptions
 Primitive Types

Files

file  btree.h
 

Generic BTree implementation.


file  errors.h
 

The exceptions used by Fairport.


file  primitives.h
 

Primitive structures defined by MS-PST and MAPI.


file  util.h
 

General utility functions and classes.


Functions

time_t fairport::filetime_to_time_t (ulonglong filetime)
 Convert from a filetime to time_t.
ulonglong fairport::time_t_to_filetime (time_t time)
 Convert from a time_t to filetime.
time_t fairport::vt_date_to_time_t (double vt_time)
 Convert from a VT_DATE to a time_t.
double fairport::time_t_to_vt_date (time_t time)
 Convert from a time_t to a VT_DATE.
bool fairport::test_bit (const byte *pbytes, ulong bit)
 Test to see if the specified bit in the buffer is set.
std::wstring fairport::codepage_1252_to_wstring (const std::string &cp1252)
 Convert a codepage 1252 string to a std::wstring.
std::wstring fairport::bytes_to_wstring (const std::vector< byte > &bytes)
 Convert an array of bytes to a std::wstring.
std::vector< byte > fairport::wstring_to_bytes (const std::wstring &wstr)
 Convert a std::wstring to an array of bytes.

Function Documentation

std::wstring fairport::bytes_to_wstring ( const std::vector< byte > &  bytes) [inline]

Convert an array of bytes to a std::wstring.

Parameters:
[in]bytesThe bytes to convert
Returns:
A std::wstring

Definition at line 241 of file util.h.

std::wstring fairport::codepage_1252_to_wstring ( const std::string &  cp1252) [inline]

Convert a codepage 1252 string to a std::wstring.

Parameters:
[in]cp1252A string in the Windows codepage 1252 encoding.
Returns:
A std::wstring

Definition at line 192 of file util.h.

time_t fairport::filetime_to_time_t ( ulonglong  filetime) [inline]

Convert from a filetime to time_t.

FILETIME is a Win32 date/time type representing the number of 100 ns intervals since Jan 1st, 1601. This function converts it to a standard time_t.

Parameters:
[in]filetimeThe time to convert from
Returns:
filetime, as a time_t.

Definition at line 163 of file util.h.

bool fairport::test_bit ( const byte *  pbytes,
ulong  bit 
) [inline]

Test to see if the specified bit in the buffer is set.

Parameters:
[in]pbytesThe buffer to check
[in]bitWhich bit to test
Returns:
true if the specified bit is set, false if not

Definition at line 187 of file util.h.

fairport::ulonglong fairport::time_t_to_filetime ( time_t  time) [inline]

Convert from a time_t to filetime.

FILETIME is a Win32 date/time type representing the number of 100 ns intervals since Jan 1st, 1601. This function converts to it from a standard time_t.

Parameters:
[in]timeThe time to convert from
Returns:
time, as a filetime.

Definition at line 170 of file util.h.

double fairport::time_t_to_vt_date ( time_t  time) [inline]

Convert from a time_t to a VT_DATE.

VT_DATE is an OLE date/time type where the integer part is the date and the fraction part is the time. This function converts to it from a standard time_t.

Parameters:
[in]timeThe time to convert from
Returns:
time, as a VT_DATE

Definition at line 182 of file util.h.

time_t fairport::vt_date_to_time_t ( double  vt_time) [inline]

Convert from a VT_DATE to a time_t.

VT_DATE is an OLE date/time type where the integer part is the date and the fraction part is the time. This function converts it to a standard time_t

Parameters:
[in]vt_timeThe time to convert from
Returns:
vt_time, as a time_t

Definition at line 177 of file util.h.

std::vector< fairport::byte > fairport::wstring_to_bytes ( const std::wstring &  wstr) [inline]

Convert a std::wstring to an array of bytes.

Parameters:
[in]wstrThe std::wstring to convert
Returns:
An array of bytes

Definition at line 270 of file util.h.