示例#1
0
bool decodeSpaceID(v8::Handle<v8::Value> toDecode,SpaceID& space, String& errorMessage)
{
    String spaceStr;
    bool strDecode = decodeString(toDecode,spaceStr,errorMessage);
    if (! strDecode )
        return false;

    space = SpaceID(spaceStr);
    return true;
}
 explicit SpaceObjectReference(const String& humanReadable) {
     String::size_type where=humanReadable.find(":");
     if (where==String::npos) {
         mObject=ObjectReference::null();
         mSpace=SpaceID::null();
         throw std::invalid_argument("Unable to find colon separator in SpaceObjectReference");
     } else {
         mSpace=SpaceID(humanReadable.substr(0,where));
         mObject=ObjectReference(humanReadable.substr(where+1));
     }
 }