Ejemplo n.º 1
0
	User* User::Clone()
	{ 
		mongo::BSONObj  obj;
		ToBson(obj);
		User* pNew = new User();
		pNew->FromBson(obj);
		return pNew;
	}
Ejemplo n.º 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();
		}
Ejemplo n.º 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();
		}
Ejemplo n.º 4
0
	void User::ToBson(std::string& __buf)
	{
		mongo::BSONObj  __obj;
		ToBson(__obj);
		__buf = std::string(__obj.objdata(),__obj.objsize());
	}
Ejemplo n.º 5
0
	void User::ToCompress(std::string & __buf)
	{
		mongo::BSONObj  __obj;
		ToBson(__obj);
		CUtil::Compress(__obj.objdata(),__obj.objsize(),__buf);
	}