|
|
|
@ -5,7 +5,7 @@
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2008-2017, Tomasz Sowa
|
|
|
|
|
* Copyright (c) 2008-2018, Tomasz Sowa
|
|
|
|
|
* All rights reserved.
|
|
|
|
|
*
|
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
@ -240,11 +240,11 @@ return false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
std::wstring Space::Text(const wchar_t * name) const
|
|
|
|
|
{
|
|
|
|
|
tmp_name = name;
|
|
|
|
|
return Text(tmp_name, L"");
|
|
|
|
|
}
|
|
|
|
|
//std::wstring Space::Text(const wchar_t * name) const
|
|
|
|
|
//{
|
|
|
|
|
// tmp_name = name;
|
|
|
|
|
// return Text(tmp_name, L"");
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -265,7 +265,10 @@ std::wstring Space::Text(const std::wstring & name, const wchar_t * def) const
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
return std::wstring(def);
|
|
|
|
|
if( def )
|
|
|
|
|
return std::wstring(def);
|
|
|
|
|
else
|
|
|
|
|
return std::wstring();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -287,11 +290,11 @@ std::wstring Space::Text(const std::wstring & name, const std::wstring & def) co
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
std::wstring & Space::TextRef(const wchar_t * name)
|
|
|
|
|
{
|
|
|
|
|
tmp_name = name;
|
|
|
|
|
return TextRef(tmp_name, L"");
|
|
|
|
|
}
|
|
|
|
|
//std::wstring & Space::TextRef(const wchar_t * name)
|
|
|
|
|
//{
|
|
|
|
|
// tmp_name = name;
|
|
|
|
|
// return TextRef(tmp_name, L"");
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
std::wstring & Space::TextRef(const wchar_t * name, const wchar_t * def)
|
|
|
|
@ -302,25 +305,27 @@ std::wstring & Space::TextRef(const wchar_t * name, const wchar_t * def)
|
|
|
|
|
|
|
|
|
|
std::wstring & Space::TextRef(const std::wstring & name, const wchar_t * def)
|
|
|
|
|
{
|
|
|
|
|
Value * value;
|
|
|
|
|
Table::iterator t = table.find(name);
|
|
|
|
|
|
|
|
|
|
if( t == table.end() )
|
|
|
|
|
if( t != table.end() )
|
|
|
|
|
{
|
|
|
|
|
Value & v = table[name];
|
|
|
|
|
v.push_back(def);
|
|
|
|
|
return v[0];
|
|
|
|
|
value = &t->second;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
if( t->second.empty() )
|
|
|
|
|
{
|
|
|
|
|
Value & v = t->second;
|
|
|
|
|
v.push_back(def);
|
|
|
|
|
return v[0];
|
|
|
|
|
value = &table[name];
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
|
|
|
|
|
if( value->empty() )
|
|
|
|
|
{
|
|
|
|
|
return t->second[0];
|
|
|
|
|
if( def )
|
|
|
|
|
value->push_back(def);
|
|
|
|
|
else
|
|
|
|
|
value->push_back(std::wstring());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return (*value)[0];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -332,11 +337,11 @@ std::wstring & Space::TextRef(const std::wstring & name, const std::wstring & de
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
std::string Space::TextA(const wchar_t * name) const
|
|
|
|
|
{
|
|
|
|
|
tmp_name = name;
|
|
|
|
|
return TextA(tmp_name, "");
|
|
|
|
|
}
|
|
|
|
|
//std::string Space::TextA(const wchar_t * name) const
|
|
|
|
|
//{
|
|
|
|
|
// tmp_name = name;
|
|
|
|
|
// return TextA(tmp_name, "");
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -359,7 +364,10 @@ std::string Space::TextA(const std::wstring & name, const char * def) const
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
return def;
|
|
|
|
|
if( def )
|
|
|
|
|
return std::string(def);
|
|
|
|
|
else
|
|
|
|
|
return std::string();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|