diff options
author | Carl Hetherington <carl@carlh.net> | 2009-05-12 17:03:42 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2009-05-12 17:03:42 +0000 |
commit | 3b89d9eaa03406a5e03648f47734211f09b89d62 (patch) | |
tree | 1c8d151bca327d4a5cb7047c8591aa814b9b4ec8 /libs/pbd | |
parent | 2e5c935990d6ea5cc6e9a5a6de0fd8c52e68657c (diff) |
Remove most using declarations from header files.
git-svn-id: svn://localhost/ardour2/branches/3.0@5069 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/pbd')
-rw-r--r-- | libs/pbd/file_utils.cc | 2 | ||||
-rw-r--r-- | libs/pbd/filesystem.cc | 2 | ||||
-rw-r--r-- | libs/pbd/filesystem_paths.cc | 8 | ||||
-rw-r--r-- | libs/pbd/pathscanner.cc | 1 | ||||
-rw-r--r-- | libs/pbd/pbd/file_utils.h | 15 | ||||
-rw-r--r-- | libs/pbd/pbd/filesystem.h | 18 | ||||
-rw-r--r-- | libs/pbd/pbd/filesystem_paths.h | 6 | ||||
-rw-r--r-- | libs/pbd/pbd/memento_command.h | 2 | ||||
-rw-r--r-- | libs/pbd/pbd/pathscanner.h | 87 | ||||
-rw-r--r-- | libs/pbd/pbd/receiver.h | 4 | ||||
-rw-r--r-- | libs/pbd/pbd/search_path.h | 21 | ||||
-rw-r--r-- | libs/pbd/pbd/textreceiver.h | 8 | ||||
-rw-r--r-- | libs/pbd/pbd/transmitter.h | 14 | ||||
-rw-r--r-- | libs/pbd/pbd/xml++.h | 90 | ||||
-rw-r--r-- | libs/pbd/receiver.cc | 1 | ||||
-rw-r--r-- | libs/pbd/search_path.cc | 2 | ||||
-rw-r--r-- | libs/pbd/stateful.cc | 2 | ||||
-rw-r--r-- | libs/pbd/textreceiver.cc | 2 | ||||
-rw-r--r-- | libs/pbd/xml++.cc | 2 |
19 files changed, 137 insertions, 150 deletions
diff --git a/libs/pbd/file_utils.cc b/libs/pbd/file_utils.cc index 1e9ff03c6f..3705600b22 100644 --- a/libs/pbd/file_utils.cc +++ b/libs/pbd/file_utils.cc @@ -27,6 +27,8 @@ #include "pbd/error.h" +using namespace std; + namespace PBD { void diff --git a/libs/pbd/filesystem.cc b/libs/pbd/filesystem.cc index 4d82ed2fe6..9c05962a6b 100644 --- a/libs/pbd/filesystem.cc +++ b/libs/pbd/filesystem.cc @@ -33,6 +33,8 @@ #include "i18n.h" +using namespace std; + namespace PBD { namespace sys { diff --git a/libs/pbd/filesystem_paths.cc b/libs/pbd/filesystem_paths.cc index a5c3c65c16..7f0ac62d0f 100644 --- a/libs/pbd/filesystem_paths.cc +++ b/libs/pbd/filesystem_paths.cc @@ -22,10 +22,10 @@ namespace PBD { -vector<sys::path> +std::vector<sys::path> system_data_directories () { - vector<sys::path> tmp; + std::vector<sys::path> tmp; const char * const * dirs; dirs = g_get_system_data_dirs (); @@ -40,10 +40,10 @@ system_data_directories () return tmp; } -vector<sys::path> +std::vector<sys::path> system_config_directories () { - vector<sys::path> tmp; + std::vector<sys::path> tmp; const char * const * dirs; dirs = g_get_system_config_dirs (); diff --git a/libs/pbd/pathscanner.cc b/libs/pbd/pathscanner.cc index 9b41de9544..e391708175 100644 --- a/libs/pbd/pathscanner.cc +++ b/libs/pbd/pathscanner.cc @@ -30,6 +30,7 @@ #include "pbd/pathscanner.h" #include "pbd/stl_delete.h" +using namespace std; using namespace PBD; vector<string *> * diff --git a/libs/pbd/pbd/file_utils.h b/libs/pbd/pbd/file_utils.h index ce5422db13..d63f02f787 100644 --- a/libs/pbd/pbd/file_utils.h +++ b/libs/pbd/pbd/file_utils.h @@ -29,9 +29,6 @@ namespace PBD { -using std::string; -using std::vector; - /** * Get a list of files in a directory. * @note You must join path with result to get the absolute path @@ -42,7 +39,7 @@ using std::vector; */ void get_files_in_directory (const sys::path& path, - vector<string>& result); + std::vector<std::string>& result); /** * Takes a directory path and returns all the files in the directory @@ -55,7 +52,7 @@ get_files_in_directory (const sys::path& path, void find_matching_files_in_directory (const sys::path& directory, const Glib::PatternSpec& pattern, - vector<sys::path>& result); + std::vector<sys::path>& result); /** * Takes a number of directory paths and returns all the files matching @@ -66,9 +63,9 @@ find_matching_files_in_directory (const sys::path& directory, * @param result A vector in which to place the resulting matches. */ void -find_matching_files_in_directories (const vector<sys::path>& directory_paths, +find_matching_files_in_directories (const std::vector<sys::path>& directory_paths, const Glib::PatternSpec& pattern, - vector<sys::path>& result); + std::vector<sys::path>& result); /** * Takes a SearchPath and puts a list of all the files in the search path @@ -81,7 +78,7 @@ find_matching_files_in_directories (const vector<sys::path>& directory_paths, void find_matching_files_in_search_path (const SearchPath& search_path, const Glib::PatternSpec& pattern, - vector<sys::path>& result); + std::vector<sys::path>& result); /** * Takes a search path and a file name and place the full path @@ -91,7 +88,7 @@ find_matching_files_in_search_path (const SearchPath& search_path, */ bool find_file_in_search_path (const SearchPath& search_path, - const string& filename, + const std::string& filename, sys::path& result); } // namespace PBD diff --git a/libs/pbd/pbd/filesystem.h b/libs/pbd/pbd/filesystem.h index 2d21a3fafc..f7cf1882fd 100644 --- a/libs/pbd/pbd/filesystem.h +++ b/libs/pbd/pbd/filesystem.h @@ -66,31 +66,29 @@ namespace PBD { namespace sys { -using std::string; - class path { public: path() : m_path("") { } path(const path & p) : m_path(p.m_path) { } - path(const string & s) : m_path(s) { } + path(const std::string & s) : m_path(s) { } path(const char* s) : m_path(s) { } path& operator=(const path& p) { m_path = p.m_path; return *this;} - path& operator=(const string& s) { m_path = s; return *this; } + path& operator=(const std::string& s) { m_path = s; return *this; } path& operator=(const char* s) { m_path = s; return *this; } path& operator/=(const path& rhs); - path& operator/=(const string& s); + path& operator/=(const std::string& s); path& operator/=(const char* s); - const string to_string() const { return m_path; } + const std::string to_string() const { return m_path; } /** * @return the last component of the path, if the path refers to * a file then it will be the entire filename including any extension. */ - string leaf() const; + std::string leaf () const; /** * @returns the directory component of a path without any trailing @@ -101,7 +99,7 @@ public: private: - string m_path; + std::string m_path; }; class filesystem_error : public std::runtime_error @@ -184,7 +182,7 @@ void copy_file(const path & from_path, const path & to_path); * ::basename and most other forms of basename in that it removes the * extension from the filename if the filename has one. */ -string basename (const path& p); +std::string basename (const path& p); /** * @return If the filename contains a dot, return a substring of the @@ -193,7 +191,7 @@ string basename (const path& p); * * @param p a file path. */ -string extension (const path& p); +std::string extension (const path& p); } // namespace sys diff --git a/libs/pbd/pbd/filesystem_paths.h b/libs/pbd/pbd/filesystem_paths.h index 8b767a3dfc..a31de8c64e 100644 --- a/libs/pbd/pbd/filesystem_paths.h +++ b/libs/pbd/pbd/filesystem_paths.h @@ -25,11 +25,9 @@ namespace PBD { - using std::vector; + std::vector<sys::path> system_data_directories (); - vector<sys::path> system_data_directories (); - - vector<sys::path> system_config_directories (); + std::vector<sys::path> system_config_directories (); } // namespace PBD diff --git a/libs/pbd/pbd/memento_command.h b/libs/pbd/pbd/memento_command.h index e89da70c20..b1347c169d 100644 --- a/libs/pbd/pbd/memento_command.h +++ b/libs/pbd/pbd/memento_command.h @@ -65,7 +65,7 @@ public: } virtual XMLNode &get_state() { - string name; + std::string name; if (before && after) { name = "MementoCommand"; } else if (before) { diff --git a/libs/pbd/pbd/pathscanner.h b/libs/pbd/pbd/pathscanner.h index 550aab163a..1b7ef58655 100644 --- a/libs/pbd/pbd/pathscanner.h +++ b/libs/pbd/pbd/pathscanner.h @@ -24,22 +24,19 @@ #include <string> #include <regex.h> -using std::string; -using std::vector; - class PathScanner { public: - vector<string *> *operator() (const string &dirpath, - bool (*filter)(const string &, void *arg), - void *arg, - bool match_fullpath = true, - bool return_fullpath = true, - long limit = -1, - bool recurse = false) { + std::vector<std::string *> *operator() (const std::string &dirpath, + bool (*filter)(const std::string &, void *arg), + void *arg, + bool match_fullpath = true, + bool return_fullpath = true, + long limit = -1, + bool recurse = false) { return run_scan (dirpath, - (bool (PathScanner::*)(const string &)) 0, + (bool (PathScanner::*)(const std::string &)) 0, filter, arg, match_fullpath, @@ -47,49 +44,49 @@ class PathScanner limit, recurse); } - vector<string *> *operator() (const string &dirpath, - const string ®exp, - bool match_fullpath = true, - bool return_fullpath = true, - long limit = -1, - bool recurse = false); - - string *find_first (const string &dirpath, - const string ®exp, - bool match_fullpath = true, - bool return_fullpath = true); + std::vector<std::string *> *operator() (const std::string &dirpath, + const std::string ®exp, + bool match_fullpath = true, + bool return_fullpath = true, + long limit = -1, + bool recurse = false); + + std::string *find_first (const std::string &dirpath, + const std::string ®exp, + bool match_fullpath = true, + bool return_fullpath = true); - string *find_first (const string &dirpath, - bool (*filter)(const string &, void *), - void *arg, - bool match_fullpath = true, - bool return_fullpath = true); + std::string *find_first (const std::string &dirpath, + bool (*filter)(const std::string &, void *), + void *arg, + bool match_fullpath = true, + bool return_fullpath = true); private: regex_t compiled_pattern; - bool regexp_filter (const string &str) { + bool regexp_filter (const std::string &str) { return regexec (&compiled_pattern, str.c_str(), 0, 0, 0) == 0; } - vector<string *> *run_scan (const string &dirpath, - bool (PathScanner::*mfilter) (const string &), - bool (*filter)(const string &, void *), - void *arg, - bool match_fullpath, - bool return_fullpath, - long limit, - bool recurse = false); + std::vector<std::string *> *run_scan (const std::string &dirpath, + bool (PathScanner::*mfilter) (const std::string &), + bool (*filter)(const std::string &, void *), + void *arg, + bool match_fullpath, + bool return_fullpath, + long limit, + bool recurse = false); - vector<string *> *run_scan_internal (vector<string*>*, - const string &dirpath, - bool (PathScanner::*mfilter) (const string &), - bool (*filter)(const string &, void *), - void *arg, - bool match_fullpath, - bool return_fullpath, - long limit, - bool recurse = false); + std::vector<std::string *> *run_scan_internal (std::vector<std::string*>*, + const std::string &dirpath, + bool (PathScanner::*mfilter) (const std::string &), + bool (*filter)(const std::string &, void *), + void *arg, + bool match_fullpath, + bool return_fullpath, + long limit, + bool recurse = false); }; #endif // __libmisc_pathscanner_h__ diff --git a/libs/pbd/pbd/receiver.h b/libs/pbd/pbd/receiver.h index 93192ce787..5e32c7d67f 100644 --- a/libs/pbd/pbd/receiver.h +++ b/libs/pbd/pbd/receiver.h @@ -26,8 +26,6 @@ #include "transmitter.h" -using std::vector; - class strstream; class Receiver : virtual public sigc::trackable @@ -43,7 +41,7 @@ class Receiver : virtual public sigc::trackable virtual void receive (Transmitter::Channel, const char *) = 0; private: - vector<sigc::connection *> connections; + std::vector<sigc::connection *> connections; }; #endif // __libmisc_receiver_h__ diff --git a/libs/pbd/pbd/search_path.h b/libs/pbd/pbd/search_path.h index 6163aae607..1148384daa 100644 --- a/libs/pbd/pbd/search_path.h +++ b/libs/pbd/pbd/search_path.h @@ -27,9 +27,6 @@ namespace PBD { -using std::string; -using std::vector; - /** * @class The SearchPath class is a helper class for getting a * vector of paths contained in a search path string where a @@ -39,7 +36,7 @@ using std::vector; * The SearchPath class does not test whether the paths exist * or are directories. It is basically just a container. */ -class SearchPath : public vector<sys::path> +class SearchPath : public std::vector<sys::path> { public: /** @@ -58,14 +55,14 @@ public: * * @param search_path A path string. */ - SearchPath (const string& search_path); + SearchPath (const std::string& search_path); /** * Initialize SearchPath from a sys::path. * * @param directory_path A directory path. */ - SearchPath (const sys::path& directory_path); + SearchPath (const PBD::sys::path& directory_path); /** * Initialize SearchPath from a vector of paths that may or may @@ -73,7 +70,7 @@ public: * * @param path A path. */ - SearchPath (const vector<sys::path>& paths); + SearchPath (const std::vector<PBD::sys::path>& paths); /** * @return a search path string. @@ -81,7 +78,7 @@ public: * The string that is returned contains the platform specific * path separator. */ - const string to_string () const; + const std::string to_string () const; /** * Add all the directories in path to this. @@ -91,7 +88,7 @@ public: /** * Add another directory path to the search path. */ - SearchPath& operator+= (const sys::path& directory_path); + SearchPath& operator+= (const PBD::sys::path& directory_path); /** * Concatenate another SearchPath onto this. @@ -101,18 +98,18 @@ public: /** * Add another path to the search path. */ - SearchPath& operator+ (const sys::path& directory_path); + SearchPath& operator+ (const PBD::sys::path& directory_path); /** * Add a sub-directory to each path in the search path. * @param subdir The directory name, it should not contain * any path separating tokens. */ - SearchPath& add_subdirectory_to_paths (const string& subdir); + SearchPath& add_subdirectory_to_paths (const std::string& subdir); protected: void add_directory (const sys::path& directory_path); - void add_directories (const vector<sys::path>& paths); + void add_directories (const std::vector<PBD::sys::path>& paths); }; } // namespace PBD diff --git a/libs/pbd/pbd/textreceiver.h b/libs/pbd/pbd/textreceiver.h index e5900fc652..c9a1d0aecc 100644 --- a/libs/pbd/pbd/textreceiver.h +++ b/libs/pbd/pbd/textreceiver.h @@ -24,20 +24,16 @@ #include "receiver.h" -using std::string; -using std::cout; -using std::endl; - class TextReceiver : public Receiver { public: - TextReceiver (const string &n); + TextReceiver (const std::string &n); protected: void receive (Transmitter::Channel, const char *); private: - string name; + std::string name; }; #endif //__libmisc_textreceiver_h__ diff --git a/libs/pbd/pbd/transmitter.h b/libs/pbd/pbd/transmitter.h index 61ac9bd8d8..6da521dd26 100644 --- a/libs/pbd/pbd/transmitter.h +++ b/libs/pbd/pbd/transmitter.h @@ -25,10 +25,6 @@ #include <sigc++/sigc++.h> -using std::cout; -using std::cerr; -using std::endl; - class Transmitter : public std::stringstream { @@ -82,11 +78,11 @@ endmsg (std::ostream &ostr) see if ostr == cout, and handle it specially. */ - if (&ostr == &cout) { - cout << endl; + if (&ostr == &std::cout) { + std::cout << std::endl; return ostr; - } else if (&ostr == &cerr) { - cerr << endl; + } else if (&ostr == &std::cerr) { + std::cerr << std::endl; return ostr; } @@ -97,7 +93,7 @@ endmsg (std::ostream &ostr) it and assume that that will be enough. */ - ostr << endl; + ostr << std::endl; } return ostr; diff --git a/libs/pbd/pbd/xml++.h b/libs/pbd/pbd/xml++.h index 9427c7070c..65ab0f2c03 100644 --- a/libs/pbd/pbd/xml++.h +++ b/libs/pbd/pbd/xml++.h @@ -18,75 +18,71 @@ #ifndef __XML_H #define __XML_H -using std::string; -using std::map; -using std::list; - class XMLTree; class XMLNode; class XMLProperty; -typedef list<XMLNode *> XMLNodeList; -typedef list<boost::shared_ptr<XMLNode> > XMLSharedNodeList; -typedef XMLNodeList::iterator XMLNodeIterator; -typedef XMLNodeList::const_iterator XMLNodeConstIterator; -typedef list<XMLProperty*> XMLPropertyList; -typedef XMLPropertyList::iterator XMLPropertyIterator; -typedef XMLPropertyList::const_iterator XMLPropertyConstIterator; -typedef map<string, XMLProperty*> XMLPropertyMap; +typedef std::list<XMLNode *> XMLNodeList; +typedef std::list<boost::shared_ptr<XMLNode> > XMLSharedNodeList; +typedef XMLNodeList::iterator XMLNodeIterator; +typedef XMLNodeList::const_iterator XMLNodeConstIterator; +typedef std::list<XMLProperty*> XMLPropertyList; +typedef XMLPropertyList::iterator XMLPropertyIterator; +typedef XMLPropertyList::const_iterator XMLPropertyConstIterator; +typedef std::map<std::string, XMLProperty*> XMLPropertyMap; class XMLTree { public: XMLTree(); - XMLTree(const string& fn, bool validate = false); + XMLTree(const std::string& fn, bool validate = false); XMLTree(const XMLTree*); ~XMLTree(); XMLNode* root() const { return _root; } XMLNode* set_root(XMLNode* n) { return _root = n; } - const string& filename() const { return _filename; } - const string& set_filename(const string& fn) { return _filename = fn; } + const std::string& filename() const { return _filename; } + const std::string& set_filename(const std::string& fn) { return _filename = fn; } int compression() const { return _compression; } int set_compression(int); bool read() { return read_internal(false); } - bool read(const string& fn) { set_filename(fn); return read_internal(false); } + bool read(const std::string& fn) { set_filename(fn); return read_internal(false); } bool read_and_validate() { return read_internal(true); } - bool read_and_validate(const string& fn) { set_filename(fn); return read_internal(true); } - bool read_buffer(const string&); + bool read_and_validate(const std::string& fn) { set_filename(fn); return read_internal(true); } + bool read_buffer(const std::string&); bool write() const; - bool write(const string& fn) { set_filename(fn); return write(); } + bool write(const std::string& fn) { set_filename(fn); return write(); } void debug (FILE*) const; - const string& write_buffer() const; + const std::string& write_buffer() const; private: bool read_internal(bool validate); - string _filename; - XMLNode* _root; - int _compression; + std::string _filename; + XMLNode* _root; + int _compression; }; class XMLNode { public: - XMLNode(const string& name); - XMLNode(const string& name, const string& content); + XMLNode(const std::string& name); + XMLNode(const std::string& name, const std::string& content); XMLNode(const XMLNode& other); ~XMLNode(); - const string& name() const { return _name; } + const std::string& name() const { return _name; } bool is_content() const { return _is_content; } - const string& content() const { return _content; } - const string& set_content(const string&); - XMLNode* add_content(const string& s = string()); + const std::string& content() const { return _content; } + const std::string& set_content(const std::string&); + XMLNode* add_content(const std::string& s = std::string()); - const XMLNodeList& children(const string& str = string()) const; + const XMLNodeList& children(const std::string& str = std::string()) const; XMLNode* child(const char*) const; XMLNode* add_child(const char *); XMLNode* add_child_copy(const XMLNode&); @@ -97,27 +93,27 @@ public: const XMLPropertyList& properties() const { return _proplist; } XMLProperty* property(const char*); - XMLProperty* property(const string&); + XMLProperty* property(const std::string&); const XMLProperty* property(const char* n) const { return ((XMLNode*)this)->property(n); } - const XMLProperty* property(const string& n) const { return ((XMLNode*)this)->property(n); } + const XMLProperty* property(const std::string& n) const { return ((XMLNode*)this)->property(n); } - XMLProperty* add_property(const char* name, const string& value); + XMLProperty* add_property(const char* name, const std::string& value); XMLProperty* add_property(const char* name, const char* value = ""); XMLProperty* add_property(const char* name, const long value); - void remove_property(const string&); + void remove_property(const std::string&); /** Remove all nodes with the name passed to remove_nodes */ - void remove_nodes(const string&); + void remove_nodes(const std::string&); /** Remove and delete all nodes with the name passed to remove_nodes */ - void remove_nodes_and_delete(const string&); + void remove_nodes_and_delete(const std::string&); /** Remove and delete all nodes with property prop matching val */ - void remove_nodes_and_delete(const string& propname, const string& val); + void remove_nodes_and_delete(const std::string& propname, const std::string& val); private: - string _name; + std::string _name; bool _is_content; - string _content; + std::string _content; XMLNodeList _children; XMLPropertyList _proplist; XMLPropertyMap _propmap; @@ -126,27 +122,27 @@ private: class XMLProperty { public: - XMLProperty(const string& n, const string& v = string()); + XMLProperty(const std::string& n, const std::string& v = std::string()); ~XMLProperty(); - const string& name() const { return _name; } - const string& value() const { return _value; } - const string& set_value(const string& v) { return _value = v; } + const std::string& name() const { return _name; } + const std::string& value() const { return _value; } + const std::string& set_value(const std::string& v) { return _value = v; } private: - string _name; - string _value; + std::string _name; + std::string _value; }; class XMLException: public std::exception { public: - explicit XMLException(const string msg) : _message(msg) {} + explicit XMLException(const std::string msg) : _message(msg) {} virtual ~XMLException() throw() {} virtual const char* what() const throw() { return _message.c_str(); } private: - string _message; + std::string _message; }; #endif /* __XML_H */ diff --git a/libs/pbd/receiver.cc b/libs/pbd/receiver.cc index 456ff3ae79..c9df4595db 100644 --- a/libs/pbd/receiver.cc +++ b/libs/pbd/receiver.cc @@ -23,6 +23,7 @@ #include "pbd/receiver.h" #include "pbd/transmitter.h" +using namespace std; using namespace sigc; Receiver::Receiver () {} diff --git a/libs/pbd/search_path.cc b/libs/pbd/search_path.cc index 2238b233fe..f305e24f90 100644 --- a/libs/pbd/search_path.cc +++ b/libs/pbd/search_path.cc @@ -21,6 +21,8 @@ #include "pbd/search_path.h" #include "pbd/error.h" +using namespace std; + namespace { #ifdef WIN32 diff --git a/libs/pbd/stateful.cc b/libs/pbd/stateful.cc index 8846226ad3..12ae4306ed 100644 --- a/libs/pbd/stateful.cc +++ b/libs/pbd/stateful.cc @@ -27,6 +27,8 @@ #include "i18n.h" +using namespace std; + namespace PBD { Stateful::Stateful () diff --git a/libs/pbd/textreceiver.cc b/libs/pbd/textreceiver.cc index 2cd1cf3712..19c84c6b14 100644 --- a/libs/pbd/textreceiver.cc +++ b/libs/pbd/textreceiver.cc @@ -23,6 +23,8 @@ #include "pbd/textreceiver.h" +using namespace std; + TextReceiver::TextReceiver (const string &n) { diff --git a/libs/pbd/xml++.cc b/libs/pbd/xml++.cc index 9f7ef6007f..ec1c8a7b60 100644 --- a/libs/pbd/xml++.cc +++ b/libs/pbd/xml++.cc @@ -12,6 +12,8 @@ #define XML_VERSION "1.0" +using namespace std; + static XMLNode* readnode(xmlNodePtr); static void writenode(xmlDocPtr, XMLNode*, xmlNodePtr, int); static XMLSharedNodeList* find_impl(xmlXPathContext* ctxt, const string& xpath); |