Ardour  9.0-pre0-582-g084a23a80d
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 #pragma once
25 
26 #include <string>
27 #include <vector>
28 
29 #include "pbd/libpbd_visibility.h"
30 
31 namespace PBD {
32 
44 class LIBPBD_TEMPLATE_API Searchpath : public std::vector<std::string>
45 {
46 public:
51 
63  LIBPBD_TEMPLATE_MEMBER_API Searchpath (const std::string& search_path);
64 
71  LIBPBD_TEMPLATE_MEMBER_API Searchpath (const std::vector<std::string>& paths);
72 
74 
81  LIBPBD_TEMPLATE_MEMBER_API const std::string to_string () const;
82 
86  LIBPBD_TEMPLATE_MEMBER_API Searchpath& operator+= (const Searchpath& spath);
87 
91  LIBPBD_TEMPLATE_MEMBER_API Searchpath& operator+= (const std::string& directory_path);
92 
96  LIBPBD_TEMPLATE_MEMBER_API const Searchpath operator+ (const Searchpath& other);
97 
101  LIBPBD_TEMPLATE_MEMBER_API const Searchpath operator+ (const std::string& directory_path);
102 
107 
111  LIBPBD_TEMPLATE_MEMBER_API Searchpath& operator-= (const std::string& directory_path);
112 
119 
123  LIBPBD_TEMPLATE_MEMBER_API void add_directory (const std::string& directory_path);
124 
128  LIBPBD_TEMPLATE_MEMBER_API void add_directories (const std::vector<std::string>& paths);
129 
133  LIBPBD_TEMPLATE_MEMBER_API void remove_directory (const std::string& directory_path);
134 
138  LIBPBD_TEMPLATE_MEMBER_API void remove_directories (const std::vector<std::string>& paths);
139 
143  LIBPBD_TEMPLATE_MEMBER_API bool contains (const std::string& path) const;
144 };
145 
146 LIBPBD_API void export_search_path (const std::string& base_dir, const char* varname, const char* dir);
147 
148 
149 } // namespace PBD
150 
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:73
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)