added: to Space:
void Add(const wchar_t * name, bool value); void Add(const wchar_t * name, int value); void Add(const wchar_t * name, long value); git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@382 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
parent
04ca4692b3
commit
d0272485dc
|
@ -343,6 +343,37 @@ return def;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void Space::Add(const wchar_t * name, bool value)
|
||||||
|
{
|
||||||
|
if( value )
|
||||||
|
Add(name, L"true");
|
||||||
|
else
|
||||||
|
Add(name, L"false");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Space::Add(const std::wstring & name, bool value)
|
||||||
|
{
|
||||||
|
Add(name.c_str(), value);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Space::Add(const wchar_t * name, int value)
|
||||||
|
{
|
||||||
|
wchar_t value_str[50];
|
||||||
|
|
||||||
|
swprintf(value_str, sizeof(value_str)/sizeof(wchar_t), L"%d", value);
|
||||||
|
Add(name, value_str);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Space::Add(const std::wstring & name, int value)
|
||||||
|
{
|
||||||
|
Add(name.c_str(), value);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void Space::Add(const wchar_t * name, long value)
|
void Space::Add(const wchar_t * name, long value)
|
||||||
{
|
{
|
||||||
wchar_t value_str[50];
|
wchar_t value_str[50];
|
||||||
|
@ -354,10 +385,7 @@ wchar_t value_str[50];
|
||||||
|
|
||||||
void Space::Add(const std::wstring & name, long value)
|
void Space::Add(const std::wstring & name, long value)
|
||||||
{
|
{
|
||||||
wchar_t value_str[50];
|
Add(name.c_str(), value);
|
||||||
|
|
||||||
swprintf(value_str, sizeof(value_str)/sizeof(wchar_t), L"%ld", value);
|
|
||||||
Add(name.c_str(), value_str);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -212,6 +212,12 @@ public:
|
||||||
bool Bool(const wchar_t * name, bool def);
|
bool Bool(const wchar_t * name, bool def);
|
||||||
bool Bool(const std::wstring & name, bool def);
|
bool Bool(const std::wstring & name, bool def);
|
||||||
|
|
||||||
|
void Add(const wchar_t * name, bool value);
|
||||||
|
void Add(const std::wstring & name, bool value);
|
||||||
|
|
||||||
|
void Add(const wchar_t * name, int value);
|
||||||
|
void Add(const std::wstring & name, int value);
|
||||||
|
|
||||||
void Add(const wchar_t * name, long value);
|
void Add(const wchar_t * name, long value);
|
||||||
void Add(const std::wstring & name, long value);
|
void Add(const std::wstring & name, long value);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue