genesis-3d_engine/Engine/buildingtools/idlcompiler/idlarg.cc
zhongdaohuan 6e8fbca745 genesis-3d engine version 1.3.
match the genesis editor version 1.3.0.653.
2014-05-05 14:50:33 +08:00

77 lines
1.8 KiB
C++

//------------------------------------------------------------------------------
// idlarg.cc
// (C) 2006 Radon Labs GmbH
//------------------------------------------------------------------------------
#include "stdneb.h"
#include "tools/idlcompiler/idlarg.h"
namespace Tools
{
__ImplementClass(Tools::IDLArg, 'ILAG', Core::RefCounted);
using namespace Util;
using namespace IO;
//------------------------------------------------------------------------------
/**
*/
IDLArg::IDLArg()
{
// empty
}
//------------------------------------------------------------------------------
/**
*/
bool
IDLArg::Parse(XmlReader* reader)
{
n_assert(0 != reader);
this->name = reader->GetString("name");
this->type = reader->GetString("type");
this->defaultValue = reader->GetOptString("default", "");
this->serialize = reader->GetOptBool("serialize", false);
if (reader->SetToFirstChild("Encode"))
{
this->encodeCode = reader->GetContent();
reader->SetToParent();
}
if (reader->SetToFirstChild("Decode"))
{
this->decodeCode = reader->GetContent();
reader->SetToParent();
}
return true;
}
//------------------------------------------------------------------------------
/**
*/
bool
IDLArg::IsValidType(const Util::String& str)
{
if ((str == "Char")
||(str == "String")
||(str == "Float")
||(str == "Float2")
||(str == "Float4")
||(str == "Int")
||(str == "UInt")
||(str == "Bool")
||(str == "Matrix44")
||(str == "Point")
||(str == "Vector")
||(str == "Double")
||(str == "Short")
||(str == "UShort")
||(str == "Blob")
||(str == "Guid"))
{
return true;
}
return false;
}
} // namespace Tools