added: to Space:
std::wstring & FindAdd(const WTextStream & name); std::wstring & Add(const wchar_t * name, const WTextStream & value); std::wstring & Add(const std::wstring & name, const WTextStream & value); std::wstring & Add(const WTextStream & name, const WTextStream & value); git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@430 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -39,6 +39,7 @@
|
||||
#include <wchar.h>
|
||||
#include "space.h"
|
||||
#include "utf8/utf8.h"
|
||||
#include "textstream/textstream.h"
|
||||
|
||||
|
||||
|
||||
@@ -396,6 +397,22 @@ return *value;
|
||||
}
|
||||
|
||||
|
||||
std::wstring & Space::FindAdd(const WTextStream & name)
|
||||
{
|
||||
name.to_string(tmp_name);
|
||||
std::wstring * value = GetValue(tmp_name);
|
||||
|
||||
if( !value )
|
||||
{
|
||||
value = &table_single[tmp_name];
|
||||
table.erase(tmp_name);
|
||||
}
|
||||
|
||||
return *value;
|
||||
}
|
||||
|
||||
|
||||
|
||||
std::wstring & Space::Add(const wchar_t * name, bool value)
|
||||
{
|
||||
if( value )
|
||||
@@ -503,6 +520,46 @@ return val;
|
||||
}
|
||||
|
||||
|
||||
std::wstring & Space::Add(const wchar_t * name, const WTextStream & value)
|
||||
{
|
||||
tmp_name = name;
|
||||
value.to_string(tmp_value_text, true);
|
||||
|
||||
std::wstring & val = table_single[tmp_name];
|
||||
val = tmp_value_text;
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
|
||||
|
||||
std::wstring & Space::Add(const std::wstring & name, const WTextStream & value)
|
||||
{
|
||||
tmp_name = name;
|
||||
value.to_string(tmp_value_text, true);
|
||||
|
||||
std::wstring & val = table_single[tmp_name];
|
||||
val = tmp_value_text;
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
|
||||
|
||||
std::wstring & Space::Add(const WTextStream & name, const WTextStream & value)
|
||||
{
|
||||
name.to_string(tmp_name, true);
|
||||
value.to_string(tmp_value_text, true);
|
||||
|
||||
std::wstring & val = table_single[tmp_name];
|
||||
val = tmp_value_text;
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void Space::Remove(const wchar_t * name)
|
||||
{
|
||||
|
Reference in New Issue
Block a user