const wchar_t* OMDataStreamProperty::storedName(void) const { TRACE("OMDataStreamProperty::storedName"); if (_storedName == 0) { OMDataStreamProperty* p = const_cast<OMDataStreamProperty*>(this); p->_storedName = OMStoredObject::streamName(_name, propertyId()); } return _storedName; }
Property* Property::Create(const char* typeName, const char* instanceName, const char* agentType, const char* propertyName, const char* valueStr) { BEHAVIAC_ASSERT(propertyName); BEHAVIAC_ASSERT(!StringUtils::EndsWith(propertyName, "]")); const CMemberBase* pMember = 0; bool bConst = false; if (agentType) { CStringID agentClassId(agentType); CStringID propertyId(propertyName); pMember = Agent::FindMemberBase(agentClassId, propertyId); } else { BEHAVIAC_ASSERT(true); } Property* p = Property::create(pMember, bConst, typeName, propertyName, instanceName, valueStr); return p; }
bool ParseForStruct(const char* str, behaviac::string& strT, behaviac::map<behaviac::CStringID, behaviac::Property*>& props) { const char* pB = str; while (*str) { char c = *str; if (c == ';' || c == '{' || c == '}') { const char* p = pB; while (p <= str) { strT += *p++; } pB = str + 1; } else if (c == ' ') { //par or property behaviac::string propName; const char* p = pB; while (*p != '=') { propName += *p++; } //skip '=' BEHAVIAC_ASSERT(*p == '='); p++; behaviac::string typeStr; while (*p != ' ') { typeStr += *p++; } bool bStatic = false; if (typeStr == "static") { //skip ' ' BEHAVIAC_ASSERT(*p == ' '); p++; while (*p != ' ') { typeStr += *p++; } bStatic = true; } behaviac::string parName; //skip ' ' BEHAVIAC_ASSERT(*str == ' '); str++; while (*str != ';') { parName += *str++; } behaviac::CStringID propertyId(propName.c_str()); props[propertyId] = behaviac::Property::Create(typeStr.c_str(), parName.c_str(), bStatic, 0); //skip ';' BEHAVIAC_ASSERT(*str == ';'); pB = str + 1; } str++; } return true; }