Ardour  8.12
search_path.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2007-2015 Tim Mayberry <mojofunk@gmail.com>
3  * Copyright (C) 2008-2009 David Robillard <d@drobilla.net>
4  * Copyright (C) 2008-2015 Paul Davis <paul@linuxaudiosystems.com>
5  * Copyright (C) 2009-2011 Carl Hetherington <carl@carlh.net>
6  * Copyright (C) 2013-2014 John Emmas <john@creativepost.co.uk>
7  * Copyright (C) 2013-2015 Robin Gareus <robin@gareus.org>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License along
20  * with this program; if not, write to the Free Software Foundation, Inc.,
21  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22  */
23 
24 #ifndef __libpbd_search_path_h__
25 #define __libpbd_search_path_h__
26 
27 #include <string>
28 #include <vector>
29 
30 #include "pbd/libpbd_visibility.h"
31 
32 namespace PBD {
33 
45 class LIBPBD_TEMPLATE_API Searchpath : public std::vector<std::string>
46 {
47 public:
52 
64  LIBPBD_TEMPLATE_MEMBER_API Searchpath (const std::string& search_path);
65 
72  LIBPBD_TEMPLATE_MEMBER_API Searchpath (const std::vector<std::string>& paths);
73 
75 
82  LIBPBD_TEMPLATE_MEMBER_API const std::string to_string () const;
83 
87  LIBPBD_TEMPLATE_MEMBER_API Searchpath& operator+= (const Searchpath& spath);
88 
92  LIBPBD_TEMPLATE_MEMBER_API Searchpath& operator+= (const std::string& directory_path);
93 
97  LIBPBD_TEMPLATE_MEMBER_API const Searchpath operator+ (const Searchpath& other);
98 
102  LIBPBD_TEMPLATE_MEMBER_API const Searchpath operator+ (const std::string& directory_path);
103 
108 
112  LIBPBD_TEMPLATE_MEMBER_API Searchpath& operator-= (const std::string& directory_path);
113 
120 
124  LIBPBD_TEMPLATE_MEMBER_API void add_directory (const std::string& directory_path);
125 
129  LIBPBD_TEMPLATE_MEMBER_API void add_directories (const std::vector<std::string>& paths);
130 
134  LIBPBD_TEMPLATE_MEMBER_API void remove_directory (const std::string& directory_path);
135 
139  LIBPBD_TEMPLATE_MEMBER_API void remove_directories (const std::vector<std::string>& paths);
140 
144  LIBPBD_TEMPLATE_MEMBER_API bool contains (const std::string& path) const;
145 };
146 
147 LIBPBD_API void export_search_path (const std::string& base_dir, const char* varname, const char* dir);
148 
149 
150 } // namespace PBD
151 
152 #endif /* __libpbd_search_path_h__ */
LIBPBD_TEMPLATE_MEMBER_API Searchpath & add_subdirectory_to_paths(const std::string &subdir)
LIBPBD_TEMPLATE_MEMBER_API void add_directory(const std::string &directory_path)
LIBPBD_TEMPLATE_MEMBER_API ~Searchpath()
Definition: search_path.h:74
LIBPBD_TEMPLATE_MEMBER_API void add_directories(const std::vector< std::string > &paths)
LIBPBD_TEMPLATE_MEMBER_API Searchpath()
LIBPBD_TEMPLATE_MEMBER_API Searchpath(const std::string &search_path)
LIBPBD_TEMPLATE_MEMBER_API void remove_directory(const std::string &directory_path)
LIBPBD_TEMPLATE_MEMBER_API const std::string to_string() const
LIBPBD_TEMPLATE_MEMBER_API void remove_directories(const std::vector< std::string > &paths)
LIBPBD_TEMPLATE_MEMBER_API Searchpath(const std::vector< std::string > &paths)
LIBPBD_TEMPLATE_MEMBER_API bool contains(const std::string &path) const
#define LIBPBD_TEMPLATE_API
#define LIBPBD_TEMPLATE_MEMBER_API
#define LIBPBD_API
Definition: axis_view.h:42
void export_search_path(const std::string &base_dir, const char *varname, const char *dir)