Internal change PiperOrigin-RevId: 314403302 Change-Id: Ic9ea19b8436791e064a3a7c06ffec1c2511b674e
diff --git a/libplatform/io/FileSystem.cpp b/libplatform/io/FileSystem.cpp index 122af24..2490036 100644 --- a/libplatform/io/FileSystem.cpp +++ b/libplatform/io/FileSystem.cpp
@@ -28,15 +28,15 @@ /////////////////////////////////////////////////////////////////////////////// void -FileSystem::pathnameCleanup( string& name ) +FileSystem::pathnameCleanup( std::string& name ) { - string bad; + std::string bad; // fold repeating directory separators bad = DIR_SEPARATOR; bad += DIR_SEPARATOR; - for( string::size_type pos = name.find( bad ); - pos != string::npos; + for( std::string::size_type pos = name.find( bad ); + pos != std::string::npos; pos = name.find( bad, pos ) ) { name.replace( pos, bad.length(), DIR_SEPARATOR ); @@ -46,8 +46,8 @@ bad = DIR_SEPARATOR; bad += '.'; bad += DIR_SEPARATOR; - for( string::size_type pos = name.find( bad ); - pos != string::npos; + for( std::string::size_type pos = name.find( bad ); + pos != std::string::npos; pos = name.find( bad, pos ) ) { name.replace( pos, bad.length(), DIR_SEPARATOR ); @@ -57,18 +57,18 @@ /////////////////////////////////////////////////////////////////////////////// void -FileSystem::pathnameOnlyExtension( string& name ) +FileSystem::pathnameOnlyExtension( std::string& name ) { // compute basename - string::size_type dot_pos = name.rfind( '.' ); - string::size_type slash_pos = name.rfind( DIR_SEPARATOR ); + std::string::size_type dot_pos = name.rfind( '.' ); + std::string::size_type slash_pos = name.rfind( DIR_SEPARATOR ); // dot_pos must be after slash_pos - if( slash_pos != string::npos && dot_pos < slash_pos ) - dot_pos = string::npos; + if( slash_pos != std::string::npos && dot_pos < slash_pos ) + dot_pos = std::string::npos; // return empty-string if no dot - if( dot_pos == string::npos ) { + if( dot_pos == std::string::npos ) { name.resize( 0 ); return; } @@ -80,27 +80,27 @@ /////////////////////////////////////////////////////////////////////////////// void -FileSystem::pathnameStripExtension( string& name ) +FileSystem::pathnameStripExtension( std::string& name ) { pathnameCleanup( name ); // compute basename - string::size_type dot_pos = name.rfind( '.' ); - string::size_type slash_pos = name.rfind( DIR_SEPARATOR ); + std::string::size_type dot_pos = name.rfind( '.' ); + std::string::size_type slash_pos = name.rfind( DIR_SEPARATOR ); // dot_pos must be after slash_pos - if( slash_pos != string::npos && dot_pos < slash_pos ) - dot_pos = string::npos; + if( slash_pos != std::string::npos && dot_pos < slash_pos ) + dot_pos = std::string::npos; // chop extension - if( dot_pos != string::npos ) + if( dot_pos != std::string::npos ) name.resize( dot_pos ); } /////////////////////////////////////////////////////////////////////////////// void -FileSystem::pathnameTemp( string& name, string dir, string prefix, string suffix ) +FileSystem::pathnameTemp( std::string& name, std::string dir, std::string prefix, std::string suffix ) { ostringstream buf;
diff --git a/libplatform/io/FileSystem.h b/libplatform/io/FileSystem.h index 5f5d288..eca867a 100644 --- a/libplatform/io/FileSystem.h +++ b/libplatform/io/FileSystem.h
@@ -36,8 +36,8 @@ class MP4V2_EXPORT FileSystem { public: - static string DIR_SEPARATOR; //!< separator string used in file pathnames - static string PATH_SEPARATOR; //!< separator string used in search-paths + static std::string DIR_SEPARATOR; //!< separator string used in file pathnames + static std::string PATH_SEPARATOR; //!< separator string used in search-paths /////////////////////////////////////////////////////////////////////////// //! @@ -138,7 +138,7 @@ //! /////////////////////////////////////////////////////////////////////////// - static void pathnameTemp( string& name, string dir = ".", string prefix = "tmp", string suffix = "" ); + static void pathnameTemp( std::string& name, std::string dir = ".", std::string prefix = "tmp", std::string suffix = "" ); /////////////////////////////////////////////////////////////////////////// //! @@ -153,7 +153,7 @@ //! /////////////////////////////////////////////////////////////////////////// - static void pathnameCleanup( string& name ); + static void pathnameCleanup( std::string& name ); #if 0 TODO-KB: implement @@ -170,7 +170,7 @@ //! end in a directory-separator. //! /////////////////////////////////////////////////////////////////////////// - static void pathnameOnlyDirectory( string& name, bool trailing = true ); + static void pathnameOnlyDirectory( std::string& name, bool trailing = true ); /////////////////////////////////////////////////////////////////////////// //! @@ -183,7 +183,7 @@ //! @param name pathname to modify. //! /////////////////////////////////////////////////////////////////////////// - static void pathnameOnlyFile( string& name ); + static void pathnameOnlyFile( std::string& name ); /////////////////////////////////////////////////////////////////////////// //! @@ -197,7 +197,7 @@ //! @param name pathname to modify. //! /////////////////////////////////////////////////////////////////////////// - static void pathnameOnlyBasename( string& name ); + static void pathnameOnlyBasename( std::string& name ); #endif /////////////////////////////////////////////////////////////////////////// @@ -213,7 +213,7 @@ //! /////////////////////////////////////////////////////////////////////////// - static void pathnameOnlyExtension( string& name ); + static void pathnameOnlyExtension( std::string& name ); /////////////////////////////////////////////////////////////////////////// //! @@ -228,7 +228,7 @@ //! /////////////////////////////////////////////////////////////////////////// - static void pathnameStripExtension( string& name ); + static void pathnameStripExtension( std::string& name ); }; ///////////////////////////////////////////////////////////////////////////////
diff --git a/libplatform/io/FileSystem_posix.cpp b/libplatform/io/FileSystem_posix.cpp index 70388dc..44a7ce2 100644 --- a/libplatform/io/FileSystem_posix.cpp +++ b/libplatform/io/FileSystem_posix.cpp
@@ -29,7 +29,7 @@ /////////////////////////////////////////////////////////////////////////////// bool -FileSystem::exists( string path_ ) +FileSystem::exists( std::string path_ ) { struct stat buf; return stat( path_.c_str(), &buf ) == 0; @@ -38,7 +38,7 @@ /////////////////////////////////////////////////////////////////////////////// bool -FileSystem::isDirectory( string path_ ) +FileSystem::isDirectory( std::string path_ ) { struct stat buf; if( stat( path_.c_str(), &buf )) @@ -49,7 +49,7 @@ /////////////////////////////////////////////////////////////////////////////// bool -FileSystem::isFile( string path_ ) +FileSystem::isFile( std::string path_ ) { struct stat buf; if( stat( path_.c_str(), &buf )) @@ -60,7 +60,7 @@ /////////////////////////////////////////////////////////////////////////////// bool -FileSystem::getFileSize( string path_, File::Size& size_ ) +FileSystem::getFileSize( std::string path_, File::Size& size_ ) { size_ = 0; struct stat buf; @@ -73,15 +73,15 @@ /////////////////////////////////////////////////////////////////////////////// bool -FileSystem::rename( string from, string to ) +FileSystem::rename( std::string from, std::string to ) { return ::rename( from.c_str(), to.c_str() ) != 0; } /////////////////////////////////////////////////////////////////////////////// -string FileSystem::DIR_SEPARATOR = "/"; -string FileSystem::PATH_SEPARATOR = ":"; +std::string FileSystem::DIR_SEPARATOR = "/"; +std::string FileSystem::PATH_SEPARATOR = ":"; ///////////////////////////////////////////////////////////////////////////////
diff --git a/libutil/Database.cpp b/libutil/Database.cpp index 5d89e0b..d9be88e 100644 --- a/libutil/Database.cpp +++ b/libutil/Database.cpp
@@ -27,7 +27,7 @@ /////////////////////////////////////////////////////////////////////////////// -Database::Database( const string& filename, const string& key ) +Database::Database( const std::string& filename, const std::string& key ) : _filename ( filename ) , _key ( key ) { @@ -51,7 +51,7 @@ /////////////////////////////////////////////////////////////////////////////// bool -Database::open( bool write, string& fname ) +Database::open( bool write, std::string& fname ) { _currentKeyValue.clear(); @@ -63,12 +63,12 @@ /////////////////////////////////////////////////////////////////////////////// void -Database::parseData( std::map<string,string>& data ) +Database::parseData( std::map<std::string,std::string>& data ) { data.clear(); - string name; - string value; + std::string name; + std::string value; if ( _currentKeyValue.length() ) { data[ _key ] = _currentKeyValue; @@ -87,7 +87,7 @@ /////////////////////////////////////////////////////////////////////////////// bool -Database::parsePair( string& name, string& value ) +Database::parsePair( std::string& name, std::string& value ) { enum Mode { LTRIM, COMMENT, NAME, DELIM, VALUE }; Mode mode = LTRIM;
diff --git a/libutil/Database.h b/libutil/Database.h index 1195569..362c10f 100644 --- a/libutil/Database.h +++ b/libutil/Database.h
@@ -53,7 +53,7 @@ /// @param file specifies filename for IO operations. /// @param key specifies the name of primary key. /// - Database( const string& file, const string& key ); + Database( const std::string& file, const std::string& key ); /// Close database file. void close(); @@ -69,18 +69,18 @@ /// /// @return <b>true</b> on error. /// - bool open( bool write, string& fname ); + bool open( bool write, std::string& fname ); /// Parse a record-data from open intput stream. /// /// @param data is populated with NAME/VALUE pairs if any. /// - void parseData( std::map<string,string>& data ); + void parseData( std::map<std::string,std::string>& data ); /////////////////////////////////////////////////////////////////////////// - const string _filename; // filename (basename only) used for database - const string _key; // name of key for record boundries + const std::string _filename; // filename (basename only) used for database + const std::string _key; // name of key for record boundries fstream _stream; // // IO object private: @@ -91,11 +91,11 @@ /// /// @return <b>true</b> on error (no name/value pair was parised). /// - bool parsePair( string& name, string& value ); + bool parsePair( std::string& name, std::string& value ); /*************************************************************************/ - string _currentKeyValue; + std::string _currentKeyValue; }; ///////////////////////////////////////////////////////////////////////////////
diff --git a/libutil/Timecode.cpp b/libutil/Timecode.cpp index 53366c2..d334515 100644 --- a/libutil/Timecode.cpp +++ b/libutil/Timecode.cpp
@@ -50,7 +50,7 @@ /////////////////////////////////////////////////////////////////////////////// -Timecode::Timecode( const string& time_, double scale_ ) +Timecode::Timecode( const std::string& time_, double scale_ ) : _scale ( scale_ < 1.0 ? 1.0 : scale_ ) , _duration ( 0 ) , _format ( FRAME ) @@ -222,10 +222,10 @@ /////////////////////////////////////////////////////////////////////////////// bool -Timecode::parse( const string& time, string* outError ) +Timecode::parse( const std::string& time, std::string* outError ) { - string outErrorPlacebo; - string& error = outError ? *outError : outErrorPlacebo; + std::string outErrorPlacebo; + std::string& error = outError ? *outError : outErrorPlacebo; error.clear(); _format = FRAME; @@ -245,8 +245,8 @@ int nsemi = 0; int ndot = 0; - const string::size_type max = time.length(); - for( string::size_type i = 0; i < max; i++ ) { + const std::string::size_type max = time.length(); + for( std::string::size_type i = 0; i < max; i++ ) { switch( time[i] ) { case ':': nsect++; @@ -314,8 +314,8 @@ } istringstream convert; - string tbuffer; - for( string::size_type i = 0; i < max; i++ ) { + std::string tbuffer; + for( std::string::size_type i = 0; i < max; i++ ) { const char c = time[i]; switch( c ) { case ':':
diff --git a/libutil/Timecode.h b/libutil/Timecode.h index 077b811..9c8f6bf 100644 --- a/libutil/Timecode.h +++ b/libutil/Timecode.h
@@ -57,7 +57,7 @@ double _scale; uint64_t _duration; Format _format; - string _svalue; + std::string _svalue; uint64_t _hours; uint64_t _minutes; @@ -68,7 +68,7 @@ const double& scale; const uint64_t& duration; const Format& format; - const string& svalue; + const std::string& svalue; const uint64_t& hours; const uint64_t& minutes; @@ -77,7 +77,7 @@ public: Timecode( const Timecode& ); - explicit Timecode( const string&, double = 1.0 ); + explicit Timecode( const std::string&, double = 1.0 ); explicit Timecode( uint64_t = 0, double = 1.0 ); Timecode& operator= ( const Timecode& ); @@ -94,7 +94,7 @@ Timecode operator+ ( const Timecode& ) const; Timecode operator- ( const Timecode& ) const; - bool parse( const string&, string* = NULL ); + bool parse( const std::string&, std::string* = NULL ); void reset();
diff --git a/libutil/TrackModifier.cpp b/libutil/TrackModifier.cpp index 91934fd..186f8c9 100644 --- a/libutil/TrackModifier.cpp +++ b/libutil/TrackModifier.cpp
@@ -70,11 +70,11 @@ /////////////////////////////////////////////////////////////////////////////// void -TrackModifier::dump( std::ostream& out, const string& xind ) +TrackModifier::dump( std::ostream& out, const std::string& xind ) { const uint32_t w = 14; - const string eq = " = "; - const string ind = " "; + const std::string eq = " = "; + const std::string ind = " "; out << left << xind << "track[" << trackIndex << "] id=" << trackId << '\n' << xind << ind << std::setw(w) << "type" << eq @@ -131,7 +131,7 @@ uint8_t* buffer; uint32_t size; _props.userDataName->GetValue( &buffer, &size ); - _userDataName = string( reinterpret_cast<char*>(buffer), size ); + _userDataName = std::string( reinterpret_cast<char*>(buffer), size ); } else { _userDataName.clear(); @@ -141,7 +141,7 @@ /////////////////////////////////////////////////////////////////////////////// bool& -TrackModifier::fromString( const string& src, bool& dst ) +TrackModifier::fromString( const std::string& src, bool& dst ) { if( src == "true" ) dst = true; @@ -163,7 +163,7 @@ /////////////////////////////////////////////////////////////////////////////// float& -TrackModifier::fromString( const string& src, float& dst ) +TrackModifier::fromString( const std::string& src, float& dst ) { istringstream iss( src ); iss >> dst; @@ -179,7 +179,7 @@ /////////////////////////////////////////////////////////////////////////////// uint16_t& -TrackModifier::fromString( const string& src, uint16_t& dst ) +TrackModifier::fromString( const std::string& src, uint16_t& dst ) { istringstream iss( src ); iss >> dst; @@ -243,7 +243,7 @@ } void -TrackModifier::setAlternateGroup( const string& value ) +TrackModifier::setAlternateGroup( const std::string& value ) { uint16_t tmp; setAlternateGroup( fromString( value, tmp )); @@ -260,7 +260,7 @@ } void -TrackModifier::setEnabled( const string& value ) +TrackModifier::setEnabled( const std::string& value ) { bool tmp; setEnabled( fromString( value, tmp )); @@ -269,7 +269,7 @@ /////////////////////////////////////////////////////////////////////////////// void -TrackModifier::setHandlerName( const string& value ) +TrackModifier::setHandlerName( const std::string& value ) { _props.handlerName.SetValue( value.c_str() ); fetch(); @@ -284,7 +284,7 @@ } void -TrackModifier::setHeight( const string& value ) +TrackModifier::setHeight( const std::string& value ) { float tmp; setHeight( fromString( value, tmp )); @@ -301,7 +301,7 @@ } void -TrackModifier::setInMovie( const string& value ) +TrackModifier::setInMovie( const std::string& value ) { bool tmp; setInMovie( fromString( value, tmp )); @@ -318,7 +318,7 @@ } void -TrackModifier::setInPreview( const string& value ) +TrackModifier::setInPreview( const std::string& value ) { bool tmp; setInPreview( fromString( value, tmp )); @@ -334,7 +334,7 @@ } void -TrackModifier::setLanguage( const string& value ) +TrackModifier::setLanguage( const std::string& value ) { setLanguage( bmff::enumLanguageCode.toType( value )); } @@ -349,7 +349,7 @@ } void -TrackModifier::setLayer( const string& value ) +TrackModifier::setLayer( const std::string& value ) { uint16_t tmp; setLayer( fromString( value, tmp )); @@ -358,7 +358,7 @@ /////////////////////////////////////////////////////////////////////////////// void -TrackModifier::setUserDataName( const string& value ) +TrackModifier::setUserDataName( const std::string& value ) { if( !_props.userDataName ) { ostringstream oss; @@ -381,7 +381,7 @@ } void -TrackModifier::setVolume( const string& value ) +TrackModifier::setVolume( const std::string& value ) { float tmp; setVolume( fromString( value, tmp )); @@ -397,7 +397,7 @@ } void -TrackModifier::setWidth( const string& value ) +TrackModifier::setWidth( const std::string& value ) { float tmp; setWidth( fromString( value, tmp )); @@ -405,7 +405,7 @@ /////////////////////////////////////////////////////////////////////////////// -string +std::string TrackModifier::toString( bool value ) { ostringstream oss; @@ -415,7 +415,7 @@ /////////////////////////////////////////////////////////////////////////////// -string +std::string TrackModifier::toString( float value, uint8_t i, uint8_t f ) { ostringstream oss; @@ -425,8 +425,8 @@ /////////////////////////////////////////////////////////////////////////////// -string -TrackModifier::toStringTrackType( const string& code ) +std::string +TrackModifier::toStringTrackType( const std::string& code ) { if( !code.compare( "vide" )) // 14496-12 return "video"; @@ -443,7 +443,7 @@ if( !code.compare( "subt" )) // QTFF return "subtitle"; - return string( "(" ) + code + ")"; + return std::string( "(" ) + code + ")"; } ///////////////////////////////////////////////////////////////////////////////
diff --git a/libutil/TrackModifier.h b/libutil/TrackModifier.h index 3c586a3..1715d56 100644 --- a/libutil/TrackModifier.h +++ b/libutil/TrackModifier.h
@@ -81,11 +81,11 @@ bmff::LanguageCode _language; // Handler Reference - string _handlerType; - string _handlerName; + std::string _handlerType; + std::string _handlerName; // User Data name - string _userDataName; + std::string _userDataName; public: MP4File& file; @@ -103,10 +103,10 @@ const bmff::LanguageCode& language; - const string& handlerType; - const string& handlerName; + const std::string& handlerType; + const std::string& handlerName; - const string& userDataName; + const std::string& userDataName; public: TrackModifier( MP4FileHandle, uint16_t ); @@ -121,36 +121,36 @@ void setWidth ( float ); void setHeight ( float ); void setLanguage ( bmff::LanguageCode ); - void setHandlerName ( const string& ); - void setUserDataName ( const string& ); + void setHandlerName ( const std::string& ); + void setUserDataName ( const std::string& ); // set by string - void setEnabled ( const string& ); - void setInMovie ( const string& ); - void setInPreview ( const string& ); - void setLayer ( const string& ); - void setAlternateGroup ( const string& ); - void setVolume ( const string& ); - void setWidth ( const string& ); - void setHeight ( const string& ); - void setLanguage ( const string& ); + void setEnabled ( const std::string& ); + void setInMovie ( const std::string& ); + void setInPreview ( const std::string& ); + void setLayer ( const std::string& ); + void setAlternateGroup ( const std::string& ); + void setVolume ( const std::string& ); + void setWidth ( const std::string& ); + void setHeight ( const std::string& ); + void setLanguage ( const std::string& ); bool hasUserDataName() const; void removeUserDataName(); - void dump( std::ostream&, const string& ); + void dump( std::ostream&, const std::string& ); private: void fetch(); - static string toString( bool ); - static string toString( float, uint8_t, uint8_t ); + static std::string toString( bool ); + static std::string toString( float, uint8_t, uint8_t ); - static bool& fromString( const string&, bool& ); - static float& fromString( const string&, float& ); - static uint16_t& fromString( const string&, uint16_t& ); + static bool& fromString( const std::string&, bool& ); + static float& fromString( const std::string&, float& ); + static uint16_t& fromString( const std::string&, uint16_t& ); - static string toStringTrackType( const string& ); + static std::string toStringTrackType( const std::string& ); }; ///////////////////////////////////////////////////////////////////////////////
diff --git a/libutil/Utility.cpp b/libutil/Utility.cpp index 9e1da97..f4d73a1 100644 --- a/libutil/Utility.cpp +++ b/libutil/Utility.cpp
@@ -27,7 +27,7 @@ /////////////////////////////////////////////////////////////////////////////// -Utility::Utility( string name_, int argc_, char** argv_ ) +Utility::Utility( std::string name_, int argc_, char** argv_ ) : _longOptions ( NULL ) , _name ( name_ ) , _argc ( argc_ ) @@ -242,8 +242,8 @@ oss << " "; - const string::size_type imax = option.descr.length(); - for( string::size_type i = 0; i < imax; i++ ) + const std::string::size_type imax = option.descr.length(); + for( std::string::size_type i = 0; i < imax; i++ ) oss << option.descr[i]; } } @@ -288,7 +288,7 @@ /////////////////////////////////////////////////////////////////////////////// bool -Utility::job( string arg ) +Utility::job( std::string arg ) { verbose2f( "job begin: %s\n", arg.c_str() ); @@ -670,7 +670,7 @@ /////////////////////////////////////////////////////////////////////////////// -Utility::Group::Group( string name_ ) +Utility::Group::Group( std::string name_ ) : name ( name_ ) , options ( _options ) { @@ -699,12 +699,12 @@ Utility::Group::add( char scode, bool shasarg, - string lname, + std::string lname, bool lhasarg, uint32_t lcode, - string descr, - string argname, - string help, + std::string descr, + std::string argname, + std::string help, bool hidden ) { Option* o = new Option( scode, shasarg, lname, lhasarg, lcode, descr, argname, help, hidden ); @@ -716,12 +716,12 @@ void Utility::Group::add( - string lname, + std::string lname, bool lhasarg, uint32_t lcode, - string descr, - string argname, - string help, + std::string descr, + std::string argname, + std::string help, bool hidden ) { add( 0, false, lname, lhasarg, lcode, descr, argname, help, hidden ); @@ -732,12 +732,12 @@ Utility::Option::Option( char scode_, bool shasarg_, - string lname_, + std::string lname_, bool lhasarg_, uint32_t lcode_, - string descr_, - string argname_, - string help_, + std::string descr_, + std::string argname_, + std::string help_, bool hidden_ ) : scode ( scode_ ) , shasarg ( shasarg_ ) @@ -753,7 +753,7 @@ /////////////////////////////////////////////////////////////////////////////// -Utility::JobContext::JobContext( string file_ ) +Utility::JobContext::JobContext( std::string file_ ) : file ( file_ ) , fileHandle ( MP4_INVALID_FILE_HANDLE ) , optimizeApplicable ( false )
diff --git a/libutil/Utility.h b/libutil/Utility.h index 38ebd38..cab6df4 100644 --- a/libutil/Utility.h +++ b/libutil/Utility.h
@@ -63,29 +63,29 @@ class MP4V2_EXPORT Option { public: - Option( char, bool, string, bool, uint32_t, string, string = "ARG", string = "", bool = false ); + Option( char, bool, std::string, bool, uint32_t, std::string, std::string = "ARG", std::string = "", bool = false ); const char scode; const bool shasarg; - const string lname; + const std::string lname; const bool lhasarg; const uint32_t lcode; - const string descr; - const string argname; - const string help; + const std::string descr; + const std::string argname; + const std::string help; const bool hidden; }; class MP4V2_EXPORT Group { public: - explicit Group( string ); + explicit Group( std::string ); ~Group(); void add( const Option& ); // options added this way will not be deleted - void add( char, bool, string, bool, uint32_t, string, string = "ARG", string = "", bool = false ); - void add( string, bool, uint32_t, string, string = "ARG", string = "", bool = false ); + void add( char, bool, std::string, bool, uint32_t, std::string, std::string = "ARG", std::string = "", bool = false ); + void add( std::string, bool, uint32_t, std::string, std::string = "ARG", std::string = "", bool = false ); - const string name; + const std::string name; public: typedef std::list<const Option*> List; @@ -102,9 +102,9 @@ class MP4V2_EXPORT JobContext { public: - JobContext( string file_ ); + JobContext( std::string file_ ); - const string file; //!< file job is working on + const std::string file; //!< file job is working on MP4FileHandle fileHandle; //!< handle of file, if applicable to job bool optimizeApplicable; //!< indicate file optimization is applicable std::list<void*> tofree; //!< memory to free at end of job @@ -116,7 +116,7 @@ bool process(); protected: - Utility( string, int, char** ); + Utility( std::string, int, char** ); void printUsage ( bool ); //!< print usage void printHelp ( bool, bool ); //!< print help @@ -133,7 +133,7 @@ void verbose3f ( const char*, ... ) MP4V2_WFORMAT_PRINTF(2,3); bool batch ( int ); //!< process all remaining arguments (jobs) - bool job ( string ); //!< process next argument + bool job ( std::string ); //!< process next argument //! open file in consideration of overwrite/force options bool openFileForWriting( io::File& ); @@ -151,13 +151,13 @@ bool process_impl(); private: - string _help; + std::string _help; prog::Option* _longOptions; - string _shortOptions; + std::string _shortOptions; protected: - const string _name; //!< executable basename + const std::string _name; //!< executable basename const int _argc; //!< arg count char* const* const _argv; //!< arg vector @@ -175,8 +175,8 @@ bool _debugImplicits; Group _group; // group to which standard options are added - string _usage; - string _description; + std::string _usage; + std::string _description; std::list<Group*> _groups; protected:
diff --git a/libutil/other.cpp b/libutil/other.cpp index 698b588..a021ba7 100644 --- a/libutil/other.cpp +++ b/libutil/other.cpp
@@ -77,12 +77,12 @@ const uint32_t cbmax = ftyp->compatibleBrands.GetCount(); for( uint32_t i = 0; i < cbmax; i++ ) { - string s = ftyp->compatibleBrands.GetValue( i ); + std::string s = ftyp->compatibleBrands.GetValue( i ); // remove spaces so brand set is presentable - string stripped; - const string::size_type max = s.length(); - for( string::size_type pos = 0; pos < max; pos++ ) { + std::string stripped; + const std::string::size_type max = s.length(); + for( std::string::size_type pos = 0; pos < max; pos++ ) { if( s[pos] != ' ' ) stripped += s[pos]; }
diff --git a/libutil/other.h b/libutil/other.h index b1e4a7b..d0483f1 100644 --- a/libutil/other.h +++ b/libutil/other.h
@@ -8,10 +8,10 @@ /////////////////////////////////////////////////////////////////////////////// struct MP4V2_EXPORT FileSummaryInfo { - typedef std::set<string> BrandSet; + typedef std::set<std::string> BrandSet; // standard ftyp box attributes - string major_brand; + std::string major_brand; uint32_t minor_version; BrandSet compatible_brands;
diff --git a/src/enum.h b/src/enum.h index f41368f..e516e99 100644 --- a/src/enum.h +++ b/src/enum.h
@@ -74,11 +74,11 @@ struct MP4V2_EXPORT Entry { T type; - const string compact; - const string formal; + const std::string compact; + const std::string formal; }; - typedef std::map<string,const Entry*,LessIgnoreCase> MapToType; + typedef std::map<std::string,const Entry*,LessIgnoreCase> MapToType; typedef std::map<T,const Entry*> MapToString; public: @@ -96,9 +96,9 @@ Enum(); ~Enum(); - T toType ( const string& ) const; - string toString ( T, bool = false ) const; - string& toString ( T, string&, bool = false ) const; + T toType ( const std::string& ) const; + std::string toString ( T, bool = false ) const; + std::string& toString ( T, std::string&, bool = false ) const; }; ///////////////////////////////////////////////////////////////////////////////
diff --git a/src/enum.tcc b/src/enum.tcc index 2790a8c..7df298d 100644 --- a/src/enum.tcc +++ b/src/enum.tcc
@@ -51,18 +51,18 @@ ////////////////////////////////////////////////////////////////////////////// template <typename T, T UNDEFINED> -string +std::string Enum<T,UNDEFINED>::toString( T value, bool formal ) const { - string buffer; + std::string buffer; return toString( value, buffer, formal ); } ////////////////////////////////////////////////////////////////////////////// template <typename T, T UNDEFINED> -string& -Enum<T,UNDEFINED>::toString( T value, string& buffer, bool formal ) const +std::string& +Enum<T,UNDEFINED>::toString( T value, std::string& buffer, bool formal ) const { const typename MapToString::const_iterator found = _mapToString.find( value ); if( found != _mapToString.end() ) { @@ -81,7 +81,7 @@ template <typename T, T UNDEFINED> T -Enum<T,UNDEFINED>::toType( const string& value ) const +Enum<T,UNDEFINED>::toType( const std::string& value ) const { // if number perform enum lookup int ivalue;
diff --git a/src/exception.cpp b/src/exception.cpp index ddc60d7..6c486c3 100644 --- a/src/exception.cpp +++ b/src/exception.cpp
@@ -29,7 +29,7 @@ /////////////////////////////////////////////////////////////////////////////// -Exception::Exception( const string& what_, +Exception::Exception( const std::string& what_, const char *file_, int line_, const char *function_ ) @@ -50,7 +50,7 @@ /////////////////////////////////////////////////////////////////////////////// -string +std::string Exception::msg() const { ostringstream retval; @@ -62,7 +62,7 @@ /////////////////////////////////////////////////////////////////////////////// -PlatformException::PlatformException( const string& what_, +PlatformException::PlatformException( const std::string& what_, int errno_, const char *file_, int line_, @@ -80,7 +80,7 @@ /////////////////////////////////////////////////////////////////////////////// -string +std::string PlatformException::msg() const { ostringstream retval;
diff --git a/src/exception.h b/src/exception.h index f0e2e4e..63a4368 100644 --- a/src/exception.h +++ b/src/exception.h
@@ -32,32 +32,32 @@ class MP4V2_EXPORT Exception { public: - explicit Exception( const string& what_, + explicit Exception( const std::string& what_, const char *file_, int line_, const char *function_ ); virtual ~Exception(); - virtual string msg() const; + virtual std::string msg() const; public: - const string what; - const string file; + const std::string what; + const std::string file; const int line; - const string function; + const std::string function; }; class MP4V2_EXPORT PlatformException : public Exception { public: - explicit PlatformException( const string& what_, + explicit PlatformException( const std::string& what_, int errno_, const char *file_, int line_, const char *function_ ); virtual ~PlatformException(); - virtual string msg() const; + virtual std::string msg() const; public: const int m_errno;
diff --git a/src/itmf/Tags.cpp b/src/itmf/Tags.cpp index e8ca481..f4d055f 100644 --- a/src/itmf/Tags.cpp +++ b/src/itmf/Tags.cpp
@@ -285,7 +285,7 @@ /////////////////////////////////////////////////////////////////////////////// void -Tags::c_setString( const char* value, string& cpp, const char*& c ) +Tags::c_setString( const char* value, std::string& cpp, const char*& c ) { if( !value ) { cpp.clear(); @@ -486,7 +486,7 @@ /////////////////////////////////////////////////////////////////////////////// void -Tags::fetchInteger( const CodeItemMap& cim, const string& code, uint8_t& cpp, const uint8_t*& c ) +Tags::fetchInteger( const CodeItemMap& cim, const std::string& code, uint8_t& cpp, const uint8_t*& c ) { cpp = 0; c = NULL; @@ -506,7 +506,7 @@ /////////////////////////////////////////////////////////////////////////////// void -Tags::fetchInteger( const CodeItemMap& cim, const string& code, uint16_t& cpp, const uint16_t*& c ) +Tags::fetchInteger( const CodeItemMap& cim, const std::string& code, uint16_t& cpp, const uint16_t*& c ) { cpp = 0; c = NULL; @@ -529,7 +529,7 @@ /////////////////////////////////////////////////////////////////////////////// void -Tags::fetchInteger( const CodeItemMap& cim, const string& code, uint32_t& cpp, const uint32_t*& c ) +Tags::fetchInteger( const CodeItemMap& cim, const std::string& code, uint32_t& cpp, const uint32_t*& c ) { cpp = 0; c = NULL; @@ -554,7 +554,7 @@ /////////////////////////////////////////////////////////////////////////////// void -Tags::fetchInteger( const CodeItemMap& cim, const string& code, uint64_t& cpp, const uint64_t*& c ) +Tags::fetchInteger( const CodeItemMap& cim, const std::string& code, uint64_t& cpp, const uint64_t*& c ) { cpp = 0; c = NULL; @@ -583,7 +583,7 @@ /////////////////////////////////////////////////////////////////////////////// void -Tags::fetchString( const CodeItemMap& cim, const string& code, string& cpp, const char*& c ) +Tags::fetchString( const CodeItemMap& cim, const std::string& code, std::string& cpp, const char*& c ) { cpp.clear(); c = NULL; @@ -604,7 +604,7 @@ /////////////////////////////////////////////////////////////////////////////// void -Tags::remove( MP4File& file, const string& code ) +Tags::remove( MP4File& file, const std::string& code ) { MP4ItmfItemList* itemList = genericGetItemsByCode( file, code ); // alloc @@ -617,7 +617,7 @@ /////////////////////////////////////////////////////////////////////////////// void -Tags::store( MP4File& file, const string& code, MP4ItmfBasicType basicType, const void* buffer, uint32_t size ) +Tags::store( MP4File& file, const std::string& code, MP4ItmfBasicType basicType, const void* buffer, uint32_t size ) { // remove existing item remove( file, code ); @@ -701,7 +701,7 @@ /////////////////////////////////////////////////////////////////////////////// void -Tags::storeInteger( MP4File& file, const string& code, uint8_t cpp, const uint8_t* c ) +Tags::storeInteger( MP4File& file, const std::string& code, uint8_t cpp, const uint8_t* c ) { if( c ) store( file, code, MP4_ITMF_BT_INTEGER, &cpp, sizeof(cpp) ); @@ -712,7 +712,7 @@ /////////////////////////////////////////////////////////////////////////////// void -Tags::storeInteger( MP4File& file, const string& code, uint16_t cpp, const uint16_t* c ) +Tags::storeInteger( MP4File& file, const std::string& code, uint16_t cpp, const uint16_t* c ) { if( c ) { uint8_t buf[2]; @@ -731,7 +731,7 @@ /////////////////////////////////////////////////////////////////////////////// void -Tags::storeInteger( MP4File& file, const string& code, uint32_t cpp, const uint32_t* c ) +Tags::storeInteger( MP4File& file, const std::string& code, uint32_t cpp, const uint32_t* c ) { if( c ) { uint8_t buf[4]; @@ -751,7 +751,7 @@ /////////////////////////////////////////////////////////////////////////////// void -Tags::storeInteger( MP4File& file, const string& code, uint64_t cpp, const uint64_t* c ) +Tags::storeInteger( MP4File& file, const std::string& code, uint64_t cpp, const uint64_t* c ) { if( c ) { uint8_t buf[8]; @@ -775,7 +775,7 @@ /////////////////////////////////////////////////////////////////////////////// void -Tags::storeString( MP4File& file, const string& code, const string& cpp, const char* c ) +Tags::storeString( MP4File& file, const std::string& code, const std::string& cpp, const char* c ) { if( c ) store( file, code, MP4_ITMF_BT_UTF8, cpp.c_str(), (uint32_t)cpp.size() ); @@ -836,61 +836,61 @@ /////////////////////////////////////////////////////////////////////////////// -const string Tags::CODE_NAME = "\xa9" "nam"; -const string Tags::CODE_ARTIST = "\xa9" "ART"; -const string Tags::CODE_ALBUMARTIST = "aART"; -const string Tags::CODE_ALBUM = "\xa9" "alb"; -const string Tags::CODE_GROUPING = "\xa9" "grp"; -const string Tags::CODE_COMPOSER = "\xa9" "wrt"; -const string Tags::CODE_COMMENTS = "\xa9" "cmt"; -const string Tags::CODE_GENRE = "\xa9" "gen"; -const string Tags::CODE_GENRETYPE = "gnre"; -const string Tags::CODE_RELEASEDATE = "\xa9" "day"; -const string Tags::CODE_TRACK = "trkn"; -const string Tags::CODE_DISK = "disk"; -const string Tags::CODE_TEMPO = "tmpo"; -const string Tags::CODE_COMPILATION = "cpil"; +const std::string Tags::CODE_NAME = "\xa9" "nam"; +const std::string Tags::CODE_ARTIST = "\xa9" "ART"; +const std::string Tags::CODE_ALBUMARTIST = "aART"; +const std::string Tags::CODE_ALBUM = "\xa9" "alb"; +const std::string Tags::CODE_GROUPING = "\xa9" "grp"; +const std::string Tags::CODE_COMPOSER = "\xa9" "wrt"; +const std::string Tags::CODE_COMMENTS = "\xa9" "cmt"; +const std::string Tags::CODE_GENRE = "\xa9" "gen"; +const std::string Tags::CODE_GENRETYPE = "gnre"; +const std::string Tags::CODE_RELEASEDATE = "\xa9" "day"; +const std::string Tags::CODE_TRACK = "trkn"; +const std::string Tags::CODE_DISK = "disk"; +const std::string Tags::CODE_TEMPO = "tmpo"; +const std::string Tags::CODE_COMPILATION = "cpil"; -const string Tags::CODE_TVSHOW = "tvsh"; -const string Tags::CODE_TVNETWORK = "tvnn"; -const string Tags::CODE_TVEPISODEID = "tven"; -const string Tags::CODE_TVSEASON = "tvsn"; -const string Tags::CODE_TVEPISODE = "tves"; +const std::string Tags::CODE_TVSHOW = "tvsh"; +const std::string Tags::CODE_TVNETWORK = "tvnn"; +const std::string Tags::CODE_TVEPISODEID = "tven"; +const std::string Tags::CODE_TVSEASON = "tvsn"; +const std::string Tags::CODE_TVEPISODE = "tves"; -const string Tags::CODE_DESCRIPTION = "desc"; -const string Tags::CODE_LONGDESCRIPTION = "ldes"; -const string Tags::CODE_LYRICS = "\xa9" "lyr"; +const std::string Tags::CODE_DESCRIPTION = "desc"; +const std::string Tags::CODE_LONGDESCRIPTION = "ldes"; +const std::string Tags::CODE_LYRICS = "\xa9" "lyr"; -const string Tags::CODE_SORTNAME = "sonm"; -const string Tags::CODE_SORTARTIST = "soar"; -const string Tags::CODE_SORTALBUMARTIST = "soaa"; -const string Tags::CODE_SORTALBUM = "soal"; -const string Tags::CODE_SORTCOMPOSER = "soco"; -const string Tags::CODE_SORTTVSHOW = "sosn"; +const std::string Tags::CODE_SORTNAME = "sonm"; +const std::string Tags::CODE_SORTARTIST = "soar"; +const std::string Tags::CODE_SORTALBUMARTIST = "soaa"; +const std::string Tags::CODE_SORTALBUM = "soal"; +const std::string Tags::CODE_SORTCOMPOSER = "soco"; +const std::string Tags::CODE_SORTTVSHOW = "sosn"; -const string Tags::CODE_COPYRIGHT = "cprt"; -const string Tags::CODE_ENCODINGTOOL = "\xa9" "too"; -const string Tags::CODE_ENCODEDBY = "\xa9" "enc"; -const string Tags::CODE_PURCHASEDATE = "purd"; +const std::string Tags::CODE_COPYRIGHT = "cprt"; +const std::string Tags::CODE_ENCODINGTOOL = "\xa9" "too"; +const std::string Tags::CODE_ENCODEDBY = "\xa9" "enc"; +const std::string Tags::CODE_PURCHASEDATE = "purd"; -const string Tags::CODE_PODCAST = "pcst"; -const string Tags::CODE_KEYWORDS = "keyw"; -const string Tags::CODE_CATEGORY = "catg"; +const std::string Tags::CODE_PODCAST = "pcst"; +const std::string Tags::CODE_KEYWORDS = "keyw"; +const std::string Tags::CODE_CATEGORY = "catg"; -const string Tags::CODE_HDVIDEO = "hdvd"; -const string Tags::CODE_MEDIATYPE = "stik"; -const string Tags::CODE_CONTENTRATING = "rtng"; -const string Tags::CODE_GAPLESS = "pgap"; +const std::string Tags::CODE_HDVIDEO = "hdvd"; +const std::string Tags::CODE_MEDIATYPE = "stik"; +const std::string Tags::CODE_CONTENTRATING = "rtng"; +const std::string Tags::CODE_GAPLESS = "pgap"; -const string Tags::CODE_ITUNESACCOUNT = "apID"; -const string Tags::CODE_ITUNESACCOUNTTYPE = "akID"; -const string Tags::CODE_ITUNESCOUNTRY = "sfID"; -const string Tags::CODE_CONTENTID = "cnID"; -const string Tags::CODE_ARTISTID = "atID"; -const string Tags::CODE_PLAYLISTID = "plID"; -const string Tags::CODE_GENREID = "geID"; -const string Tags::CODE_COMPOSERID = "cmID"; -const string Tags::CODE_XID = "xid "; +const std::string Tags::CODE_ITUNESACCOUNT = "apID"; +const std::string Tags::CODE_ITUNESACCOUNTTYPE = "akID"; +const std::string Tags::CODE_ITUNESCOUNTRY = "sfID"; +const std::string Tags::CODE_CONTENTID = "cnID"; +const std::string Tags::CODE_ARTISTID = "atID"; +const std::string Tags::CODE_PLAYLISTID = "plID"; +const std::string Tags::CODE_GENREID = "geID"; +const std::string Tags::CODE_COMPOSERID = "cmID"; +const std::string Tags::CODE_XID = "xid "; ///////////////////////////////////////////////////////////////////////////////
diff --git a/src/itmf/Tags.h b/src/itmf/Tags.h index bc6fdff..2f0de9e 100644 --- a/src/itmf/Tags.h +++ b/src/itmf/Tags.h
@@ -34,112 +34,112 @@ class Tags { public: - static const string CODE_NAME; - static const string CODE_ARTIST; - static const string CODE_ALBUMARTIST; - static const string CODE_ALBUM; - static const string CODE_GROUPING; - static const string CODE_COMPOSER; - static const string CODE_COMMENTS; - static const string CODE_GENRE; - static const string CODE_GENRETYPE; - static const string CODE_RELEASEDATE; - static const string CODE_TRACK; - static const string CODE_DISK; - static const string CODE_TEMPO; - static const string CODE_COMPILATION; + static const std::string CODE_NAME; + static const std::string CODE_ARTIST; + static const std::string CODE_ALBUMARTIST; + static const std::string CODE_ALBUM; + static const std::string CODE_GROUPING; + static const std::string CODE_COMPOSER; + static const std::string CODE_COMMENTS; + static const std::string CODE_GENRE; + static const std::string CODE_GENRETYPE; + static const std::string CODE_RELEASEDATE; + static const std::string CODE_TRACK; + static const std::string CODE_DISK; + static const std::string CODE_TEMPO; + static const std::string CODE_COMPILATION; - static const string CODE_TVSHOW; - static const string CODE_TVNETWORK; - static const string CODE_TVEPISODEID; - static const string CODE_TVSEASON; - static const string CODE_TVEPISODE; + static const std::string CODE_TVSHOW; + static const std::string CODE_TVNETWORK; + static const std::string CODE_TVEPISODEID; + static const std::string CODE_TVSEASON; + static const std::string CODE_TVEPISODE; - static const string CODE_DESCRIPTION; - static const string CODE_LONGDESCRIPTION; - static const string CODE_LYRICS; + static const std::string CODE_DESCRIPTION; + static const std::string CODE_LONGDESCRIPTION; + static const std::string CODE_LYRICS; - static const string CODE_SORTNAME; - static const string CODE_SORTARTIST; - static const string CODE_SORTALBUMARTIST; - static const string CODE_SORTALBUM; - static const string CODE_SORTCOMPOSER; - static const string CODE_SORTTVSHOW; + static const std::string CODE_SORTNAME; + static const std::string CODE_SORTARTIST; + static const std::string CODE_SORTALBUMARTIST; + static const std::string CODE_SORTALBUM; + static const std::string CODE_SORTCOMPOSER; + static const std::string CODE_SORTTVSHOW; - static const string CODE_COPYRIGHT; - static const string CODE_ENCODINGTOOL; - static const string CODE_ENCODEDBY; - static const string CODE_PURCHASEDATE; + static const std::string CODE_COPYRIGHT; + static const std::string CODE_ENCODINGTOOL; + static const std::string CODE_ENCODEDBY; + static const std::string CODE_PURCHASEDATE; - static const string CODE_PODCAST; - static const string CODE_KEYWORDS; - static const string CODE_CATEGORY; + static const std::string CODE_PODCAST; + static const std::string CODE_KEYWORDS; + static const std::string CODE_CATEGORY; - static const string CODE_HDVIDEO; - static const string CODE_MEDIATYPE; - static const string CODE_CONTENTRATING; - static const string CODE_GAPLESS; + static const std::string CODE_HDVIDEO; + static const std::string CODE_MEDIATYPE; + static const std::string CODE_CONTENTRATING; + static const std::string CODE_GAPLESS; - static const string CODE_ITUNESACCOUNT; - static const string CODE_ITUNESACCOUNTTYPE; - static const string CODE_ITUNESCOUNTRY; - static const string CODE_CONTENTID; - static const string CODE_ARTISTID; - static const string CODE_PLAYLISTID; - static const string CODE_GENREID; - static const string CODE_COMPOSERID; - static const string CODE_XID; + static const std::string CODE_ITUNESACCOUNT; + static const std::string CODE_ITUNESACCOUNTTYPE; + static const std::string CODE_ITUNESCOUNTRY; + static const std::string CODE_CONTENTID; + static const std::string CODE_ARTISTID; + static const std::string CODE_PLAYLISTID; + static const std::string CODE_GENREID; + static const std::string CODE_COMPOSERID; + static const std::string CODE_XID; public: - string name; - string artist; - string albumArtist; - string album; - string grouping; - string composer; - string comments; - string genre; + std::string name; + std::string artist; + std::string albumArtist; + std::string album; + std::string grouping; + std::string composer; + std::string comments; + std::string genre; uint16_t genreType; - string releaseDate; + std::string releaseDate; MP4TagTrack track; MP4TagDisk disk; uint16_t tempo; uint8_t compilation; - string tvShow; - string tvEpisodeID; + std::string tvShow; + std::string tvEpisodeID; uint32_t tvSeason; uint32_t tvEpisode; - string tvNetwork; + std::string tvNetwork; - string description; - string longDescription; - string lyrics; + std::string description; + std::string longDescription; + std::string lyrics; - string sortName; - string sortArtist; - string sortAlbumArtist; - string sortAlbum; - string sortComposer; - string sortTVShow; + std::string sortName; + std::string sortArtist; + std::string sortAlbumArtist; + std::string sortAlbum; + std::string sortComposer; + std::string sortTVShow; CoverArtBox::ItemList artwork; - string copyright; - string encodingTool; - string encodedBy; - string purchaseDate; + std::string copyright; + std::string encodingTool; + std::string encodedBy; + std::string purchaseDate; uint8_t podcast; - string keywords; - string category; + std::string keywords; + std::string category; uint8_t hdVideo; uint8_t mediaType; uint8_t contentRating; uint8_t gapless; - string iTunesAccount; + std::string iTunesAccount; uint8_t iTunesAccountType; uint32_t iTunesCountry; uint32_t contentID; @@ -147,7 +147,7 @@ uint64_t playlistID; uint32_t genreID; uint32_t composerID; - string xid; + std::string xid; bool hasMetadata; @@ -164,7 +164,7 @@ void c_setArtwork ( MP4Tags*&, uint32_t, MP4TagArtwork& ); void c_removeArtwork ( MP4Tags*&, uint32_t ); - void c_setString ( const char*, string&, const char*& ); + void c_setString ( const char*, std::string&, const char*& ); void c_setInteger ( const uint8_t*, uint8_t&, const uint8_t*& ); void c_setInteger ( const uint16_t*, uint16_t&, const uint16_t*& ); void c_setInteger ( const uint32_t*, uint32_t&, const uint32_t*& ); @@ -174,31 +174,31 @@ void c_setDisk ( const MP4TagDisk*, MP4TagDisk&, const MP4TagDisk*& ); private: - typedef std::map<string,MP4ItmfItem*> CodeItemMap; + typedef std::map<std::string,MP4ItmfItem*> CodeItemMap; private: - void fetchString ( const CodeItemMap&, const string&, string&, const char*& ); - void fetchInteger ( const CodeItemMap&, const string&, uint8_t&, const uint8_t*& ); - void fetchInteger ( const CodeItemMap&, const string&, uint16_t&, const uint16_t*& ); - void fetchInteger ( const CodeItemMap&, const string&, uint32_t&, const uint32_t*& ); - void fetchInteger ( const CodeItemMap&, const string&, uint64_t&, const uint64_t*& ); + void fetchString ( const CodeItemMap&, const std::string&, std::string&, const char*& ); + void fetchInteger ( const CodeItemMap&, const std::string&, uint8_t&, const uint8_t*& ); + void fetchInteger ( const CodeItemMap&, const std::string&, uint16_t&, const uint16_t*& ); + void fetchInteger ( const CodeItemMap&, const std::string&, uint32_t&, const uint32_t*& ); + void fetchInteger ( const CodeItemMap&, const std::string&, uint64_t&, const uint64_t*& ); void fetchGenre ( const CodeItemMap&, uint16_t&, const uint16_t*& ); void fetchTrack ( const CodeItemMap&, MP4TagTrack&, const MP4TagTrack*& ); void fetchDisk ( const CodeItemMap&, MP4TagDisk&, const MP4TagDisk*& ); - void storeString ( MP4File&, const string&, const string&, const char* ); - void storeInteger ( MP4File&, const string&, uint8_t, const uint8_t* ); - void storeInteger ( MP4File&, const string&, uint16_t, const uint16_t* ); - void storeInteger ( MP4File&, const string&, uint32_t, const uint32_t* ); - void storeInteger ( MP4File&, const string&, uint64_t, const uint64_t* ); + void storeString ( MP4File&, const std::string&, const std::string&, const char* ); + void storeInteger ( MP4File&, const std::string&, uint8_t, const uint8_t* ); + void storeInteger ( MP4File&, const std::string&, uint16_t, const uint16_t* ); + void storeInteger ( MP4File&, const std::string&, uint32_t, const uint32_t* ); + void storeInteger ( MP4File&, const std::string&, uint64_t, const uint64_t* ); void storeGenre ( MP4File&, uint16_t, const uint16_t* ); void storeTrack ( MP4File&, const MP4TagTrack&, const MP4TagTrack* ); void storeDisk ( MP4File&, const MP4TagDisk&, const MP4TagDisk* ); - void remove ( MP4File&, const string& ); - void store ( MP4File&, const string&, MP4ItmfBasicType, const void*, uint32_t ); + void remove ( MP4File&, const std::string& ); + void store ( MP4File&, const std::string&, MP4ItmfBasicType, const void*, uint32_t ); void updateArtworkShadow( MP4Tags*& ); };
diff --git a/src/itmf/generic.cpp b/src/itmf/generic.cpp index 98f77ea..d5dd7f6 100644 --- a/src/itmf/generic.cpp +++ b/src/itmf/generic.cpp
@@ -249,7 +249,7 @@ /////////////////////////////////////////////////////////////////////////////// MP4ItmfItem* -genericItemAlloc( const string& code, uint32_t numData ) +genericItemAlloc( const std::string& code, uint32_t numData ) { MP4ItmfItem* item = (MP4ItmfItem*)malloc( sizeof( MP4ItmfItem )); if( !item ) @@ -313,7 +313,7 @@ /////////////////////////////////////////////////////////////////////////////// MP4ItmfItemList* -genericGetItemsByCode( MP4File& file, const string& code ) +genericGetItemsByCode( MP4File& file, const std::string& code ) { MP4Atom* ilst = file.FindAtom( "moov.udta.meta.ilst" ); if( !ilst ) @@ -347,7 +347,7 @@ /////////////////////////////////////////////////////////////////////////////// MP4ItmfItemList* -genericGetItemsByMeaning( MP4File& file, const string& meaning, const string& name ) +genericGetItemsByMeaning( MP4File& file, const std::string& meaning, const std::string& name ) { MP4Atom* ilst = file.FindAtom( "moov.udta.meta.ilst" ); if( !ilst )
diff --git a/src/itmf/generic.h b/src/itmf/generic.h index 9edc7eb..da44c0b 100644 --- a/src/itmf/generic.h +++ b/src/itmf/generic.h
@@ -29,7 +29,7 @@ /////////////////////////////////////////////////////////////////////////////// MP4ItmfItem* -genericItemAlloc( const string& code, uint32_t numData ); +genericItemAlloc( const std::string& code, uint32_t numData ); void genericItemFree( MP4ItmfItem* item ); @@ -43,10 +43,10 @@ genericGetItems( MP4File& file ); MP4ItmfItemList* -genericGetItemsByCode( MP4File& file, const string& code ); +genericGetItemsByCode( MP4File& file, const std::string& code ); MP4ItmfItemList* -genericGetItemsByMeaning( MP4File& file, const string& meaning, const string& name ); +genericGetItemsByMeaning( MP4File& file, const std::string& meaning, const std::string& name ); ///////////////////////////////////////////////////////////////////////////////
diff --git a/src/itmf/type.cpp b/src/itmf/type.cpp index b85e429..9f86380 100644 --- a/src/itmf/type.cpp +++ b/src/itmf/type.cpp
@@ -276,7 +276,7 @@ namespace { struct ImageHeader { BasicType type; - string data; + std::string data; }; // POD static init does not need singletons
diff --git a/src/log.cpp b/src/log.cpp index b76fdc8..d41dc64 100644 --- a/src/log.cpp +++ b/src/log.cpp
@@ -284,7 +284,7 @@ if (indent > 0) { - string indent_str(indent,' '); + std::string indent_str(indent,' '); // new_format << setw(indent) << setfill(' ') << "" << setw(0); // new_format << format; new_format << indent_str << format;
diff --git a/src/mp4atom.cpp b/src/mp4atom.cpp index 770f08f..9e1873e 100644 --- a/src/mp4atom.cpp +++ b/src/mp4atom.cpp
@@ -634,7 +634,7 @@ { if ( m_type[0] != '\0' ) { // create list of ancestors - std::list<string> tlist; + std::list<std::string> tlist; for( MP4Atom* atom = this; atom; atom = atom->GetParentAtom() ) { const char* const type = atom->GetType(); if( type && type[0] != '\0' ) @@ -642,9 +642,9 @@ } // create contextual atom-name - string can; - const std::list<string>::iterator ie = tlist.end(); - for( std::list<string>::iterator it = tlist.begin(); it != ie; it++ ) + std::string can; + const std::list<std::string>::iterator ie = tlist.end(); + for( std::list<std::string>::iterator it = tlist.begin(); it != ie; it++ ) can += *it + '.'; if( can.length() ) can.resize( can.length() - 1 );
diff --git a/src/mp4file.cpp b/src/mp4file.cpp index b26c3ec..377ffb7 100644 --- a/src/mp4file.cpp +++ b/src/mp4file.cpp
@@ -260,7 +260,7 @@ File* dst = NULL; // compute destination filename - string dname; + std::string dname; if( dstFileName ) { dname = dstFileName; } else { @@ -268,10 +268,10 @@ // We'll try to create it in the same directory as the srcFileName, since // it's more likely that directory is writable. In the absence of that, // we'll create it in "./", which is the default pathnameTemp() provides. - string s(srcFileName); + std::string s(srcFileName); size_t pos = s.find_last_of("\\/"); const char *d; - if (pos == string::npos) { + if (pos == std::string::npos) { d = "."; } else { s = s.substr(0, pos); @@ -3179,7 +3179,7 @@ return false; MP4LanguageCodeProperty& lang = *static_cast<MP4LanguageCodeProperty*>(prop); - string slang; + std::string slang; bmff::enumLanguageCode.toString( lang.GetValue(), slang ); if( slang.length() != 3 ) { memset( code, '\0', 4 );
diff --git a/src/mp4file.h b/src/mp4file.h index 5c6bdaf..fba2bdb 100644 --- a/src/mp4file.h +++ b/src/mp4file.h
@@ -88,7 +88,7 @@ void Read( const char* name, const MP4FileProvider* provider ); bool Modify( const char* fileName ); void Optimize( const char* srcFileName, const char* dstFileName = NULL ); - bool CopyClose( const string& copyFileName ); + bool CopyClose( const std::string& copyFileName ); void Dump( bool dumpImplicits = false ); void Close(uint32_t flags = 0); void SetInitialSeekOffset(int64_t seekOffset);
diff --git a/src/mp4property.cpp b/src/mp4property.cpp index dff16e0..601adef 100644 --- a/src/mp4property.cpp +++ b/src/mp4property.cpp
@@ -1045,7 +1045,7 @@ SetValue( value ); } -MP4LanguageCodeProperty::MP4LanguageCodeProperty( MP4Atom& parentAtom, const char* name, const string& code ) +MP4LanguageCodeProperty::MP4LanguageCodeProperty( MP4Atom& parentAtom, const char* name, const std::string& code ) : MP4Property( parentAtom, name ) { SetValue( bmff::enumLanguageCode.toType( code )); @@ -1056,7 +1056,7 @@ { uint16_t data = 0; - string svalue; + std::string svalue; bmff::enumLanguageCode.toString( _value, svalue ); if( svalue.length() == 3 ) { data = (((svalue[0] - 0x60) & 0x001f) << 10) @@ -1097,7 +1097,7 @@ code[1] = ((data & 0x03e0) >> 5) + 0x60; code[2] = ((data & 0x001f) ) + 0x60; - SetValue( bmff::enumLanguageCode.toType( string( code, sizeof(code) ))); + SetValue( bmff::enumLanguageCode.toType( std::string( code, sizeof(code) ))); } void @@ -1117,7 +1117,7 @@ { uint16_t data = 0; - string svalue; + std::string svalue; bmff::enumLanguageCode.toString( _value, svalue ); if( svalue.length() == 3 ) { data = (((svalue[0] - 0x60) & 0x001f) << 10)
diff --git a/src/mp4property.h b/src/mp4property.h index 4c7ccad..863501a 100644 --- a/src/mp4property.h +++ b/src/mp4property.h
@@ -422,8 +422,8 @@ return buf; } - bool CompareToString( const string& s, uint32_t index = 0 ) { - return string( (const char*)m_values[index], m_valueSizes[index] ) != s; + bool CompareToString( const std::string& s, uint32_t index = 0 ) { + return std::string( (const char*)m_values[index], m_valueSizes[index] ) != s; } void CopyValue(uint8_t* pValue, uint32_t index = 0) { @@ -614,7 +614,7 @@ public: explicit MP4LanguageCodeProperty( MP4Atom& parentAtom, const char* , bmff::LanguageCode = bmff::ILC_UND ); - MP4LanguageCodeProperty( MP4Atom& parentAtom, const char* , const string& ); + MP4LanguageCodeProperty( MP4Atom& parentAtom, const char* , const std::string& ); MP4PropertyType GetType(); uint32_t GetCount();
diff --git a/src/mp4track.h b/src/mp4track.h index 2a649f2..7db704b 100644 --- a/src/mp4track.h +++ b/src/mp4track.h
@@ -282,7 +282,7 @@ MP4Integer16Property* m_pElstRateProperty; MP4Integer16Property* m_pElstReservedProperty; - string m_sdtpLog; // records frame types for H264 samples + std::string m_sdtpLog; // records frame types for H264 samples }; MP4ARRAY_DECL(MP4Track, MP4Track*);
diff --git a/src/qtff/ColorParameterBox.h b/src/qtff/ColorParameterBox.h index cfbf81c..e2dbf3d 100644 --- a/src/qtff/ColorParameterBox.h +++ b/src/qtff/ColorParameterBox.h
@@ -55,13 +55,13 @@ void reset(); // convert from string CSV format. - void convertFromCSV( const string& csv ); + void convertFromCSV( const std::string& csv ); // convert to string CSV format. - string convertToCSV() const; + std::string convertToCSV() const; // convert to string CSV format with buffer. - string& convertToCSV( string& buffer ) const; + std::string& convertToCSV( std::string& buffer ) const; public: /// a 16-bit unsigned integer index.
diff --git a/src/text.cpp b/src/text.cpp index 5790f96..d6ee246 100644 --- a/src/text.cpp +++ b/src/text.cpp
@@ -5,13 +5,13 @@ /////////////////////////////////////////////////////////////////////////////// bool -LessIgnoreCase::operator()( const string& xstr, const string& ystr ) const +LessIgnoreCase::operator()( const std::string& xstr, const std::string& ystr ) const { - const string::size_type xlen = xstr.length(); - const string::size_type ylen = ystr.length(); + const std::string::size_type xlen = xstr.length(); + const std::string::size_type ylen = ystr.length(); if( xlen < ylen ) { - for( string::size_type i = 0; i < xlen; i++ ) { + for( std::string::size_type i = 0; i < xlen; i++ ) { const char x = std::toupper( xstr[i] ); const char y = std::toupper( ystr[i] ); @@ -23,7 +23,7 @@ return true; } else { - for( string::size_type i = 0; i < ylen; i++ ) { + for( std::string::size_type i = 0; i < ylen; i++ ) { const char x = std::toupper( xstr[i] ); const char y = std::toupper( ystr[i] );
diff --git a/src/text.h b/src/text.h index 5cb8d7a..39d50e0 100644 --- a/src/text.h +++ b/src/text.h
@@ -5,9 +5,9 @@ /////////////////////////////////////////////////////////////////////////////// -struct MP4V2_EXPORT LessIgnoreCase : std::less<string> +struct MP4V2_EXPORT LessIgnoreCase : std::less<std::string> { - bool operator()( const string&, const string& ) const; + bool operator()( const std::string&, const std::string& ) const; }; ///////////////////////////////////////////////////////////////////////////////
diff --git a/util/mp4art.cpp b/util/mp4art.cpp index f1454ca..42e3751 100644 --- a/util/mp4art.cpp +++ b/util/mp4art.cpp
@@ -53,10 +53,10 @@ private: struct ArtType { - string name; - string ext; - std::vector<string> cwarns; // compatibility warnings - string cerror; // compatibility error + std::string name; + std::string ext; + std::vector<std::string> cwarns; // compatibility warnings + std::string cerror; // compatibility error }; bool actionList ( JobContext& ); @@ -73,7 +73,7 @@ bool (ArtUtility::*_action)( JobContext& ); - string _artImageFile; + std::string _artImageFile; uint32_t _artFilter; }; @@ -202,7 +202,7 @@ const int widx = 3; const int wsize = 8; const int wtype = 9; - const string sep = " "; + const std::string sep = " "; if( _jobCount == 0 ) { report << std::setw(widx) << right << "IDX" << left << sep @@ -316,7 +316,7 @@ ArtUtility::extractSingle( JobContext& job, const CoverArtBox::Item& item, uint32_t index ) { // compute out filename - string out_name = job.file; + std::string out_name = job.file; FileSystem::pathnameStripExtension( out_name ); ostringstream oss;
diff --git a/util/mp4chaps.cpp b/util/mp4chaps.cpp index 12095aa..648e8f3 100644 --- a/util/mp4chaps.cpp +++ b/util/mp4chaps.cpp
@@ -92,15 +92,15 @@ bool (ChapterUtility::*_action)( JobContext& ); void fixQtScale(MP4FileHandle ); MP4TrackId getReferencingTrack( MP4FileHandle, bool& ); - string getChapterTypeName( MP4ChapterType ) const; - bool parseChapterFile( const string, std::vector<MP4Chapter_t>&, Timecode::Format& ); - bool readChapterFile( const string, char**, File::Size& ); + std::string getChapterTypeName( MP4ChapterType ) const; + bool parseChapterFile( const std::string, std::vector<MP4Chapter_t>&, Timecode::Format& ); + bool readChapterFile( const std::string, char**, File::Size& ); MP4Duration convertFrameToMillis( MP4Duration, uint32_t ); MP4ChapterType _ChapterType; ChapterFormat _ChapterFormat; uint32_t _ChaptersEvery; - string _ChapterFile; + std::string _ChapterFile; }; /////////////////////////////////////////////////////////////////////////////// @@ -356,7 +356,7 @@ } // build the filename - string outName = job.file; + std::string outName = job.file; if( _ChapterFile.empty() ) { FileSystem::pathnameStripExtension( outName ); @@ -423,7 +423,7 @@ oss << duration.svalue << ' ' << chapters[i].title << LINEND; } - string str = oss.str(); + std::string str = oss.str(); if( out.write( str.c_str(), str.size(), nout ) ) { failure = herrf( "write to %s failed: %s\n", outName.c_str(), sys::getLastErrorStr() ); @@ -461,7 +461,7 @@ Timecode::Format format; // create the chapter file name - string inName = job.file; + std::string inName = job.file; if( _ChapterFile.empty() ) { FileSystem::pathnameStripExtension( inName ); @@ -807,25 +807,25 @@ * @param chapterType the chapter type * @return a string representing the chapter type */ -string +std::string ChapterUtility::getChapterTypeName( MP4ChapterType chapterType) const { switch( chapterType ) { case MP4ChapterTypeQt: - return string( "QuickTime" ); + return std::string( "QuickTime" ); break; case MP4ChapterTypeNero: - return string( "Nero" ); + return std::string( "Nero" ); break; case MP4ChapterTypeAny: - return string( "QuickTime and Nero" ); + return std::string( "QuickTime and Nero" ); break; default: - return string( "Unknown" ); + return std::string( "Unknown" ); } } @@ -843,7 +843,7 @@ * @return true if there was an error, false otherwise */ bool -ChapterUtility::readChapterFile( const string filename, char** buffer, File::Size& fileSize ) +ChapterUtility::readChapterFile( const std::string filename, char** buffer, File::Size& fileSize ) { // open the file File in( filename, File::MODE_READ ); @@ -889,7 +889,7 @@ * @return true if there was an error, false otherwise */ bool -ChapterUtility::parseChapterFile( const string filename, std::vector<MP4Chapter_t>& chapters, Timecode::Format& format ) +ChapterUtility::parseChapterFile( const std::string filename, std::vector<MP4Chapter_t>& chapters, Timecode::Format& format ) { // get the content char * inBuf; @@ -1097,7 +1097,7 @@ chap.title[titleLen] = 0; Timecode tc( 0, CHAPTERTIMESCALE ); - string tm( timeStart ); + std::string tm( timeStart ); if( tc.parse( tm ) ) { herrf( "Unable to parse time code from \"%s\"\n", tm.c_str() );
diff --git a/util/mp4extract.cpp b/util/mp4extract.cpp index 9bf7a0a..6eae6d2 100644 --- a/util/mp4extract.cpp +++ b/util/mp4extract.cpp
@@ -187,7 +187,7 @@ void ExtractTrack( MP4FileHandle mp4File, MP4TrackId trackId, bool sampleMode, MP4SampleId sampleId, char* dstFileName ) { - static string outName; + static std::string outName; File out; if( !sampleMode ) {
diff --git a/util/mp4file.cpp b/util/mp4file.cpp index bd33f61..bb68153 100644 --- a/util/mp4file.cpp +++ b/util/mp4file.cpp
@@ -112,7 +112,7 @@ const int wbrand = 5; const int wcompat = 18; const int wsizing = 6; - const string sep = " "; + const std::string sep = " "; if( _jobCount == 0 ) { report << std::setw(wbrand) << left << "BRAND" << sep @@ -132,7 +132,7 @@ if( fileFetchSummaryInfo( job.fileHandle, info )) return herrf( "unable to fetch file summary info" ); - string compat; + std::string compat; { const FileSummaryInfo::BrandSet::iterator ie = info.compatible_brands.end(); int count = 0;
diff --git a/util/mp4info.cpp b/util/mp4info.cpp index 4c1c766..d92c9fb 100644 --- a/util/mp4info.cpp +++ b/util/mp4info.cpp
@@ -131,7 +131,7 @@ fprintf( stdout, " Genre: %s\n", tags->genre ); } if ( tags->genreType ) { - string s = itmf::enumGenreType.toString(static_cast<itmf::GenreType>(*tags->genreType ), true); + std::string s = itmf::enumGenreType.toString(static_cast<itmf::GenreType>(*tags->genreType ), true); fprintf( stdout, " GenreType: %u, %s\n", *tags->genreType, s.c_str() ); } if ( tags->grouping ) { @@ -162,14 +162,14 @@ fprintf( stdout, " Copyright: %s\n", tags->copyright ); } if ( tags->contentRating ) { - string s = itmf::enumContentRating.toString( static_cast<itmf::ContentRating>( *tags->contentRating ), true ); + std::string s = itmf::enumContentRating.toString( static_cast<itmf::ContentRating>( *tags->contentRating ), true ); fprintf( stdout, " Content Rating: %s\n", s.c_str() ); } if ( tags->hdVideo ) { fprintf( stdout, " HD Video: %s\n", *tags->hdVideo ? "yes" : "no"); } if ( tags->mediaType ) { - string s = itmf::enumStikType.toString( static_cast<itmf::StikType>( *tags->mediaType ), true ); + std::string s = itmf::enumStikType.toString( static_cast<itmf::StikType>( *tags->mediaType ), true ); fprintf( stdout, " Media Type: %s\n", s.c_str() ); } if ( tags->tvShow ) { @@ -230,14 +230,14 @@ fprintf( stdout, " iTunes Account: %s\n", tags->iTunesAccount ); } if ( tags->iTunesAccountType ) { - string s = itmf::enumAccountType.toString( static_cast<itmf::AccountType>( *tags->iTunesAccountType ), true ); + std::string s = itmf::enumAccountType.toString( static_cast<itmf::AccountType>( *tags->iTunesAccountType ), true ); fprintf( stdout, " iTunes Account Type: %s\n", s.c_str() ); } if ( tags->purchaseDate ) { fprintf( stdout, " Purchase Date: %s\n", tags->purchaseDate ); } if ( tags->iTunesCountry ) { - string s = itmf::enumCountryCode.toString( static_cast<itmf::CountryCode>( *tags->iTunesCountry ), true ); + std::string s = itmf::enumCountryCode.toString( static_cast<itmf::CountryCode>( *tags->iTunesCountry ), true ); fprintf( stdout, " iTunes Store Country: %s\n", s.c_str() ); } MP4TagsFree( tags );
diff --git a/util/mp4subtitle.cpp b/util/mp4subtitle.cpp index 7462153..a7cd1d4 100644 --- a/util/mp4subtitle.cpp +++ b/util/mp4subtitle.cpp
@@ -57,7 +57,7 @@ bool (SubtitleUtility::*_action)( JobContext& ); - string _stTextFile; + std::string _stTextFile; }; ///////////////////////////////////////////////////////////////////////////////
diff --git a/util/mp4track.cpp b/util/mp4track.cpp index 90675c9..4182c00 100644 --- a/util/mp4track.cpp +++ b/util/mp4track.cpp
@@ -129,17 +129,17 @@ qtff::ColorParameterBox::Item _colorParameterItem; qtff::PictureAspectRatioBox::Item _pictureAspectRatioItem; - void (TrackModifier::*_actionTrackModifierSet_function)( const string& ); - string _actionTrackModifierSet_name; - string _actionTrackModifierSet_value; + void (TrackModifier::*_actionTrackModifierSet_function)( const std::string& ); + std::string _actionTrackModifierSet_name; + std::string _actionTrackModifierSet_value; void (TrackModifier::*_actionTrackModifierRemove_function)(); - string _actionTrackModifierRemove_name; + std::string _actionTrackModifierRemove_name; }; /////////////////////////////////////////////////////////////////////////////// -string toStringTrackType( string ); +std::string toStringTrackType( std::string ); /////////////////////////////////////////////////////////////////////////////// @@ -277,7 +277,7 @@ const int wid = 3; const int wtype = 8; const int wparm = 6; - const string sep = " "; + const std::string sep = " "; if( _jobCount == 0 ) { report << std::setw(widx) << right << "IDX" << sep << std::setw(wid) @@ -539,7 +539,7 @@ const int wid = 3; const int wtype = 8; const int wparm = 6; - const string sep = " "; + const std::string sep = " "; if( _jobCount == 0 ) { report << std::setw(widx) << right << "IDX" << sep << std::setw(wid) @@ -956,8 +956,8 @@ /////////////////////////////////////////////////////////////////////////////// -string -toStringTrackType( string code ) +std::string +toStringTrackType( std::string code ) { if( !code.compare( "vide" )) // 14496-12 return "video"; @@ -974,7 +974,7 @@ if( !code.compare( "subt" )) // QTFF return "subtitle"; - return string( "(" ) + code + ")"; + return std::string( "(" ) + code + ")"; } ///////////////////////////////////////////////////////////////////////////////