*** NEW CODING POLICY ***
[ardour.git] / libs / pbd / filesystem_paths.cc
1 /*
2         Copyright (C) 2007 Tim Mayberry
3
4         This program is free software; you can redistribute it and/or modify
5         it under the terms of the GNU General Public License as published by
6         the Free Software Foundation; either version 2 of the License, or
7         (at your option) any later version.
8
9         This program is distributed in the hope that it will be useful,
10         but WITHOUT ANY WARRANTY; without even the implied warranty of
11         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12         GNU General Public License for more details.
13
14         You should have received a copy of the GNU General Public License
15         along with this program; if not, write to the Free Software
16         Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 */
18
19 #include <glib.h>
20
21 #include "pbd/filesystem_paths.h"
22
23 namespace PBD {
24
25 vector<sys::path>
26 system_data_directories ()
27 {
28         vector<sys::path> tmp;
29         const char * const * dirs;
30
31         dirs = g_get_system_data_dirs ();
32
33         if (dirs == NULL) return tmp;
34
35         for (int i = 0; dirs[i] != NULL; ++i)
36         {
37                 tmp.push_back(dirs[i]);
38         }
39
40         return tmp;
41 }
42
43 vector<sys::path>
44 system_config_directories ()
45 {
46         vector<sys::path> tmp;
47         const char * const * dirs;
48
49         dirs = g_get_system_config_dirs ();
50
51         if (dirs == NULL) return tmp;
52
53         for (int i = 0; dirs[i] != NULL; ++i)
54         {
55                 tmp.push_back(dirs[i]);
56         }
57
58         return tmp;
59 }
60
61 } // namespace PBD