changed: rewritten the Serialize method in SpaceToJSON class
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@429 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -42,41 +42,27 @@ namespace PT
|
||||
{
|
||||
|
||||
|
||||
void SpaceToJSON::ChangeSpacesToTable(const wchar_t * space_name)
|
||||
void SpaceToJSON::Clear()
|
||||
{
|
||||
spaces_to_table.push_back(space_name);
|
||||
numeric.clear();
|
||||
boolean.clear();
|
||||
table.clear();
|
||||
}
|
||||
|
||||
|
||||
void SpaceToJSON::ChangeSpacesToTable(const std::wstring & space_name)
|
||||
void SpaceToJSON::TreatAsTable(const wchar_t * space_name)
|
||||
{
|
||||
spaces_to_table.push_back(space_name);
|
||||
table.insert(space_name);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
bool SpaceToJSON::HasUnnamedSpace(Space & space)
|
||||
void SpaceToJSON::TreatAsTable(const std::wstring & space_name)
|
||||
{
|
||||
for(size_t i=0 ; i<space.spaces.size() ; ++i)
|
||||
if( space.spaces[i]->name.empty() )
|
||||
return true;
|
||||
|
||||
return false;
|
||||
table.insert(space_name);
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool SpaceToJSON::HasSpace(Space & space, const std::wstring & name)
|
||||
{
|
||||
for(size_t i=0 ; i<space.spaces.size() ; ++i)
|
||||
if( space.spaces[i]->name == name )
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void SpaceToJSON::TreatAsNumeric(const wchar_t * name)
|
||||
{
|
||||
numeric.insert(name);
|
||||
@@ -115,6 +101,11 @@ bool SpaceToJSON::IsBool(const std::wstring & name)
|
||||
return i != boolean.end();
|
||||
}
|
||||
|
||||
bool SpaceToJSON::IsTable(const std::wstring & name)
|
||||
{
|
||||
std::set<std::wstring>::iterator i = table.find(name);
|
||||
return i != table.end();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user