Beispiel #1
0
	User* User::Clone()
	{ 
		mongo::BSONObj  obj;
		ToBson(obj);
		User* pNew = new User();
		pNew->FromBson(obj);
		return pNew;
	}
Beispiel #2
0
		bsoncxx::document::value ToBsonDocument(Mave mave)
		{
			if (!mave.IsMap())
			{
				throw exception("Mave::ToBsonDocument(): unexpected type encountered");
			}
			bsoncxx::builder::core result{ false };
			ToBson(mave, result);
			return result.extract_document();
		}
Beispiel #3
0
		bsoncxx::array::value ToBsonArray(Mave mave)
		{
			if (!mave.IsVector())
			{
				throw exception("Mave::ToBsonArray(): unexpected type encountered");
			}
			bsoncxx::builder::core result{ true };
			ToBson(mave, result);
			return result.extract_array();
		}
Beispiel #4
0
	void User::ToBson(std::string& __buf)
	{
		mongo::BSONObj  __obj;
		ToBson(__obj);
		__buf = std::string(__obj.objdata(),__obj.objsize());
	}
Beispiel #5
0
	void User::ToCompress(std::string & __buf)
	{
		mongo::BSONObj  __obj;
		ToBson(__obj);
		CUtil::Compress(__obj.objdata(),__obj.objsize(),__buf);
	}