General/FileINI.cpp File Reference

#include "precomp.h"
#include "FileIni.h"
#include <vector>
#include <tchar.h>
#include <io.h>
#include <fcntl.h>
Include dependency graph for FileINI.cpp:

Go to the source code of this file.

Typedefs

typedef std::vector< int > INTARRAY
 Array of integers.

Functions

void TrimLen (const WCHAR *pStr, std::tstring::size_type &nLen, bool bSpace, bool bUnicode)
 Trims a character string of any _trailing_ whitespace, tab, newline, or carriage-return.
std::tstring Trim (const WCHAR *pStr, std::tstring::size_type nLen, bool bUnicode)
 Returns the trimmed string, without any leading to trailing whitespace, tab, newline, or carriage-return characters.
std::wstring Trim (const WCHAR *pStr, std::tstring::size_type nLen)
 Returns the trimmed string, without any leading to trailing whitespace, tab, newline, or carriage-return characters.
std::tstring Trim (const std::string &s)
std::tstring Trim (const std::wstring &s)
bool IsComment (const WCHAR *pStr, std::tstring::size_type nLen, bool bUnicode)
 Checks if a line is a comment line.
void FindNextLine (const WCHAR *&pLine, std::tstring::size_type nLen, bool bUnicode)
bool ReplaceVariables (LPCTSTR pValue, const TCHARSTR2STRLIST &lVariables, TCHARSTR2STRLIST::const_iterator &iPos, TCHARSTRLIST &lResults)

Detailed Description

Definition in file FileINI.cpp.


Function Documentation

void FindNextLine ( const WCHAR *&  pLine,
std::tstring::size_type  nLen,
bool  bUnicode 
)
Parameters:
pLine [in]Position to start searching from, [out]Start of next line
nLen Number of characters to jump over
bUnicode true if this is a Unicode text, false if it's ASCII

Definition at line 161 of file FileINI.cpp.

Referenced by FileINI::GetAllSections(), FileINI::GetKeys(), and FileINI::GetLines().

bool IsComment ( const WCHAR *  pStr,
std::tstring::size_type  nLen,
bool  bUnicode 
)

Checks if a line is a comment line.

Parameters:
pStr The string line to check
nLen The length of the string specified by pStr
bUnicode true if this is a unicode string, false to cast it to char
Returns:
true if it's a comment line, false otherwise

Definition at line 147 of file FileINI.cpp.

Referenced by FileINI::DoInitLine(), and FileINI::GetLines().

bool ReplaceVariables ( LPCTSTR  pValue,
const TCHARSTR2STRLIST lVariables,
TCHARSTR2STRLIST::const_iterator &  iPos,
TCHARSTRLIST lResults 
)
Parameters:
pValue The string to start with
lVariables Map of variables to replace in the string; each variable can have multiple values
iPos Current variable to check on the string
lResults List to add the result to
Returns:
true if all went well, false if something went wrong

Definition at line 690 of file FileINI.cpp.

References tstring.

std::tstring Trim ( const std::wstring &  s  ) 
Parameters:
s String to trim
Returns:
Trimmed string

Definition at line 135 of file FileINI.cpp.

References Trim().

std::tstring Trim ( const std::string &  s  ) 
Parameters:
s String to trim
Returns:
Trimmed string

Definition at line 126 of file FileINI.cpp.

References Trim().

std::wstring Trim ( const WCHAR *  pStr,
std::tstring::size_type  nLen 
)

Returns the trimmed string, without any leading to trailing whitespace, tab, newline, or carriage-return characters.

Parameters:
pStr The string to trim
Returns:
The trimmed string

Definition at line 99 of file FileINI.cpp.

std::tstring Trim ( const WCHAR *  pStr,
std::tstring::size_type  nLen,
bool  bUnicode 
)

Returns the trimmed string, without any leading to trailing whitespace, tab, newline, or carriage-return characters.

Parameters:
pStr The string to trim
Returns:
The trimmed string

Definition at line 66 of file FileINI.cpp.

References MakeTString(), and tstring.

Referenced by FileINI::DoInitLine(), FileINI::GetLines(), FileINI::GetVarValues(), and Trim().

void TrimLen ( const WCHAR *  pStr,
std::tstring::size_type &  nLen,
bool  bSpace,
bool  bUnicode 
)

Trims a character string of any _trailing_ whitespace, tab, newline, or carriage-return.

Parameters:
pStr A character string to trim
[in,out] nLen The length of the string. Returns the modified new length of the string
bSpace true to drop spaces at the end too
bUnicode true if this is a unicode string, false to assume the string is char

Definition at line 46 of file FileINI.cpp.

Referenced by FileINI::GetAllSections(), FileINI::GetKeys(), and FileINI::GetLines().


Generated on Mon Jun 18 12:40:38 2012 for CC PDF Converter by doxygen 1.6.1