summaryrefslogtreecommitdiff
path: root/libs/pbd/search_path.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libs/pbd/search_path.cc')
-rw-r--r--libs/pbd/search_path.cc33
1 files changed, 6 insertions, 27 deletions
diff --git a/libs/pbd/search_path.cc b/libs/pbd/search_path.cc
index 9956c6c763..350eea05d3 100644
--- a/libs/pbd/search_path.cc
+++ b/libs/pbd/search_path.cc
@@ -42,8 +42,7 @@ SearchPath::SearchPath (const string& path)
{
vector<sys::path> tmp;
- if(tokenize (path, string(path_delimiter), std::back_inserter (tmp)))
- {
+ if (tokenize (path, string(path_delimiter), std::back_inserter (tmp))) {
add_directories (tmp);
}
}
@@ -58,17 +57,11 @@ SearchPath::SearchPath (const vector<sys::path>& paths)
add_directories (paths);
}
-SearchPath::SearchPath (const SearchPath& other)
- : m_dirs(other.m_dirs)
-{
-
-}
-
void
SearchPath::add_directory (const sys::path& directory_path)
{
// test for existance and warn etc?
- m_dirs.push_back(directory_path);
+ push_back(directory_path);
}
void
@@ -84,7 +77,7 @@ SearchPath::to_string () const
{
string path;
- for (vector<sys::path>::const_iterator i = m_dirs.begin(); i != m_dirs.end(); ++i) {
+ for (vector<sys::path>::const_iterator i = begin(); i != end(); ++i) {
path += (*i).to_string();
path += path_delimiter;
}
@@ -94,17 +87,10 @@ SearchPath::to_string () const
return path;
}
-SearchPath&
-SearchPath::operator= (const SearchPath& path)
-{
- m_dirs = path.m_dirs;
- return *this;
-}
-
SearchPath&
SearchPath::operator+= (const SearchPath& spath)
{
- m_dirs.insert(m_dirs.end(), spath.m_dirs.begin(), spath.m_dirs.end());
+ insert(end(), spath.begin(), spath.end());
return *this;
}
@@ -126,15 +112,14 @@ SearchPath&
SearchPath::operator+ (const SearchPath& spath)
{
// concatenate paths into new SearchPath
- m_dirs.insert(m_dirs.end(), spath.m_dirs.begin(), spath.m_dirs.end());
+ insert(end(), spath.begin(), spath.end());
return *this;
}
SearchPath&
SearchPath::add_subdirectory_to_paths (const string& subdir)
{
- for (vector<sys::path>::iterator i = m_dirs.begin(); i != m_dirs.end(); ++i)
- {
+ for (vector<sys::path>::iterator i = begin(); i != end(); ++i) {
// should these new paths just be added to the end of
// the search path rather than replace?
*i /= subdir;
@@ -142,11 +127,5 @@ SearchPath::add_subdirectory_to_paths (const string& subdir)
return *this;
}
-
-SearchPath&
-SearchPath::operator/= (const string& subdir)
-{
- return add_subdirectory_to_paths (subdir);
-}
} // namespace PBD