GnuCash  5.6-150-g038405b370+
gnc-filepath-utils.h
Go to the documentation of this file.
1 /********************************************************************\
2  * gnc-filepath-utils.h -- file path resolution utilities *
3  * *
4  * This program is free software; you can redistribute it and/or *
5  * modify it under the terms of the GNU General Public License as *
6  * published by the Free Software Foundation; either version 2 of *
7  * the License, or (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, contact: *
16  * *
17  * Free Software Foundation Voice: +1-617-542-5942 *
18  * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
19  * Boston, MA 02110-1301, USA gnu@gnu.org *
20 \********************************************************************/
21 
29 #ifndef GNC_FILEPATH_UTILS_H
30 #define GNC_FILEPATH_UTILS_H
31 
32 #include <glib.h>
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
48 gchar *gnc_resolve_file_path (const gchar *filefrag);
49 
56 gchar *gnc_file_path_relative_part (const gchar *prefix, const gchar *path);
57 
65 gchar *gnc_file_path_absolute (const gchar *prefix, const gchar *relative);
66 
99 gchar *gnc_path_find_localized_html_file (const gchar *file_name);
100 
111 char * gnc_filepath_init (void);
112 
113 const gchar *gnc_userdata_dir (void);
114 gchar *gnc_build_userdata_path (const gchar *filename);
115 gchar *gnc_build_userconfig_path (const gchar *filename);
116 gchar *gnc_build_book_path (const gchar *filename);
117 gchar *gnc_build_translog_path (const gchar *filename);
118 gchar *gnc_build_data_path (const gchar *filename);
119 gchar *gnc_build_scm_path (const gchar *filename);
120 gchar *gnc_build_report_path (const gchar *filename);
121 gchar *gnc_build_reports_path (const gchar *dirname);
122 gchar *gnc_build_stdreports_path (const gchar *filename);
123 
124 const gchar *gnc_userconfig_dir (void);
125 
137 gchar *gnc_filepath_locate_pixmap (const gchar *name);
138 
139 
151 gchar *gnc_filepath_locate_data_file (const gchar *name);
152 
153 
165 gchar *gnc_filepath_locate_ui_file (const gchar *name);
166 
167 
179 gchar *gnc_filepath_locate_doc_file (const gchar *name);
180 
181 gboolean gnc_filename_is_backup (const char *filename);
182 
183 gboolean gnc_filename_is_datafile (const char *filename);
184 
185 #ifdef __cplusplus
186 } //extern "C"
187 
188 #include <fstream>
189 
200 std::ofstream gnc_open_filestream(const char *path);
201 
202 #include <vector>
203 
204 struct EnvPaths
205 {
206  const gchar *env_name;
207  const gchar *env_path;
208  gboolean modifiable;
209 };
210 
211 
217 std::vector<EnvPaths> gnc_list_all_paths ();
218 
219 #endif
220 
221 #endif /* GNC_FILEPATH_UTILS_H */
gchar * gnc_filepath_locate_data_file(const gchar *name)
Given a file name, find the file in the directories associated with this application.
gchar * gnc_build_reports_path(const gchar *dirname)
Make a path to dirname in the reports directory.
gchar * gnc_build_book_path(const gchar *filename)
Make a path to filename in the book subdirectory of the user&#39;s configuration directory.
gchar * gnc_file_path_absolute(const gchar *prefix, const gchar *relative)
Given a prefix and a relative path, return the absolute path.
gchar * gnc_build_userdata_path(const gchar *filename)
Make a path to filename in the user&#39;s gnucash data directory.
gchar * gnc_build_data_path(const gchar *filename)
Make a path to filename in the data subdirectory of the user&#39;s configuration directory.
gchar * gnc_filepath_locate_ui_file(const gchar *name)
Given a ui file name, find the file in the ui directory associated with this application.
const gchar * gnc_userdata_dir(void)
Ensure that the user&#39;s configuration directory exists and is minimally populated. ...
gchar * gnc_resolve_file_path(const gchar *filefrag)
The gnc_resolve_file_path() routine is a utility that will accept a fragmentary filename as input...
gchar * gnc_build_stdreports_path(const gchar *filename)
Make a path to filename in the standard reports directory.
gchar * gnc_build_scm_path(const gchar *filename)
Make a path to filename in the scm directory.
gchar * gnc_filepath_locate_doc_file(const gchar *name)
Given a documentation file name, find the file in the doc directory associated with this application...
gchar * gnc_build_report_path(const gchar *filename)
Make a path to filename in the report directory.
char * gnc_filepath_init(void)
Initializes the gnucash user data directory.
gchar * gnc_file_path_relative_part(const gchar *prefix, const gchar *path)
Given a prefix and a path return the relative portion of the path.
gchar * gnc_filepath_locate_pixmap(const gchar *name)
Given a pixmap/pixbuf file name, find the file in the pixmap directory associated with this applicati...
gchar * gnc_build_translog_path(const gchar *filename)
Make a path to filename in the translog subdirectory of the user&#39;s configuration directory.
gchar * gnc_build_userconfig_path(const gchar *filename)
Make a path to filename in the user&#39;s configuration directory.
gchar * gnc_path_find_localized_html_file(const gchar *file_name)
Find an absolute path to a localized version of a given relative path to a html or html related file...
const gchar * gnc_userconfig_dir(void)
Return the user&#39;s config directory for gnucash.