static bool getParam (CBaseAction::CParameter::TType type, ucstring ¶mName, ucstring ¶mValue, const std::string &argu, uint paramId) { const string separator = "|"; const string equal_separator = "="; // Go to param start uint index = 0; string::size_type pos = 0; while (index != paramId) { // Not found ? pos = argu.find_first_of(separator, pos); if (pos == string::npos) return false; pos++; index++; } // Pos is valid ? if (pos < argu.size ()) { // End string::size_type end = argu.find_first_of(separator, pos); if (end == string::npos) end = argu.size(); // Look for a '=' string::size_type equal = argu.find_first_of(equal_separator, pos); if ((equal != string::npos) && (equal >= end)) equal = string::npos; // Equal is present ? if (equal != string::npos) { // Extract parameter name paramName = argu.substr(pos, equal-pos); pos = equal+1; } // Value ? if(type==CBaseAction::CParameter::User || type==CBaseAction::CParameter::UserName) paramValue.fromUtf8(argu.substr(pos, end-pos)); else paramValue = argu.substr(pos, end-pos); // Ok return true; } return false; }
void CIXml::serial(ucstring &b) { nlassert( isReading() ); if (_BinaryStream) { _BinaryStream->serial(b); } else { // Serial a simple string string tmp; // Serial this string serial (tmp); // Return a ucstring b.fromUtf8(tmp); } }