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:
2012-07-15 22:53:24 +00:00
parent 2b88d011f6
commit f8d5a962ed
2 changed files with 68 additions and 83 deletions

View File

@@ -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();
}