diff options
Diffstat (limited to 'src/mongo/client/gridfs.h')
-rw-r--r-- | src/mongo/client/gridfs.h | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/mongo/client/gridfs.h b/src/mongo/client/gridfs.h index d7f3f3357cb..952b14b3cc7 100644 --- a/src/mongo/client/gridfs.h +++ b/src/mongo/client/gridfs.h @@ -73,7 +73,7 @@ namespace mongo { * @param dbName - root database name * @param prefix - if you want your data somewhere besides <dbname>.fs */ - GridFS( DBClientBase& client , const string& dbName , const string& prefix="fs" ); + GridFS( DBClientBase& client , const std::string& dbName , const std::string& prefix="fs" ); ~GridFS(); /** @@ -92,7 +92,7 @@ namespace mongo { * (default is to omit) * @return the file object */ - BSONObj storeFile( const string& fileName , const string& remoteName="" , const string& contentType=""); + BSONObj storeFile( const std::string& fileName , const std::string& remoteName="" , const std::string& contentType=""); /** * puts the file represented by data into the db @@ -103,14 +103,14 @@ namespace mongo { * (default is to omit) * @return the file object */ - BSONObj storeFile( const char* data , size_t length , const string& remoteName , const string& contentType=""); + BSONObj storeFile( const char* data , size_t length , const std::string& remoteName , const std::string& contentType=""); /** * removes file referenced by fileName from the db * @param fileName filename (in GridFS) of the file to remove * @return the file object */ - void removeFile( const string& fileName ); + void removeFile( const std::string& fileName ); /** * returns a file object matching the query @@ -120,28 +120,28 @@ namespace mongo { /** * equiv to findFile( { filename : filename } ) */ - GridFile findFile( const string& fileName ) const; + GridFile findFile( const std::string& fileName ) const; /** * convenience method to get all the files */ - auto_ptr<DBClientCursor> list() const; + std::auto_ptr<DBClientCursor> list() const; /** * convenience method to get all the files with a filter */ - auto_ptr<DBClientCursor> list( BSONObj query ) const; + std::auto_ptr<DBClientCursor> list( BSONObj query ) const; private: DBClientBase& _client; - string _dbName; - string _prefix; - string _filesNS; - string _chunksNS; + std::string _dbName; + std::string _prefix; + std::string _filesNS; + std::string _chunksNS; unsigned int _chunkSize; // insert fileobject. All chunks must be in DB. - BSONObj insertFile(const string& name, const OID& id, gridfs_offset length, const string& contentType); + BSONObj insertFile(const std::string& name, const OID& id, gridfs_offset length, const std::string& contentType); friend class GridFile; }; @@ -159,7 +159,7 @@ namespace mongo { return ! _obj.isEmpty(); } - string getFilename() const { + std::string getFilename() const { return _obj["filename"].str(); } @@ -171,7 +171,7 @@ namespace mongo { return (gridfs_offset)(_obj["length"].number()); } - string getContentType() const { + std::string getContentType() const { return _obj["contentType"].valuestr(); } @@ -179,11 +179,11 @@ namespace mongo { return _obj["uploadDate"].date(); } - string getMD5() const { + std::string getMD5() const { return _obj["md5"].str(); } - BSONElement getFileField( const string& name ) const { + BSONElement getFileField( const std::string& name ) const { return _obj[name]; } @@ -198,12 +198,12 @@ namespace mongo { /** write the file to the output stream */ - gridfs_offset write( ostream & out ) const; + gridfs_offset write( std::ostream & out ) const; /** write the file to this filename */ - gridfs_offset write( const string& where ) const; + gridfs_offset write( const std::string& where ) const; private: GridFile(const GridFS * grid , BSONObj obj ); |