#include "precomp.h"
#include "FileIni.h"
#include <vector>
#include <tchar.h>
#include <io.h>
#include <fcntl.h>
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) |
Definition in file FileINI.cpp.
void FindNextLine | ( | const WCHAR *& | pLine, | |
std::tstring::size_type | nLen, | |||
bool | bUnicode | |||
) |
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.
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 |
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 | |||
) |
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 |
Definition at line 690 of file FileINI.cpp.
References tstring.
std::tstring Trim | ( | const std::wstring & | s | ) |
s | String to trim |
Definition at line 135 of file FileINI.cpp.
References Trim().
std::tstring Trim | ( | const std::string & | s | ) |
s | String to trim |
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.
pStr | The string to trim |
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.
pStr | The string to trim |
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.
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().