GnuCash c935c2f+
Loading...
Searching...
No Matches
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
35extern "C" {
36#endif
37
48gchar *gnc_resolve_file_path (const gchar *filefrag);
49
56gchar *gnc_file_path_relative_part (const gchar *prefix, const gchar *path);
57
65gchar *gnc_file_path_absolute (const gchar *prefix, const gchar *relative);
66
99gchar *gnc_path_find_localized_html_file (const gchar *file_name);
100
111char * gnc_filepath_init (void);
112
113const gchar *gnc_userdata_dir (void);
114gchar *gnc_build_userdata_path (const gchar *filename);
115gchar *gnc_build_userconfig_path (const gchar *filename);
116gchar *gnc_build_book_path (const gchar *filename);
117gchar *gnc_build_translog_path (const gchar *filename);
118gchar *gnc_build_data_path (const gchar *filename);
119gchar *gnc_build_scm_path (const gchar *filename);
120gchar *gnc_build_report_path (const gchar *filename);
121gchar *gnc_build_reports_path (const gchar *dirname);
122gchar *gnc_build_stdreports_path (const gchar *filename);
123
124const gchar *gnc_userconfig_dir (void);
125
137gchar *gnc_filepath_locate_pixmap (const gchar *name);
138
139
151gchar *gnc_filepath_locate_data_file (const gchar *name);
152
153
165gchar *gnc_filepath_locate_ui_file (const gchar *name);
166
167
179gchar *gnc_filepath_locate_doc_file (const gchar *name);
180
181gboolean gnc_filename_is_backup (const char *filename);
182
183gboolean gnc_filename_is_datafile (const char *filename);
184
185#ifdef __cplusplus
186} //extern "C"
187
188#include <fstream>
189
200std::ofstream gnc_open_filestream(const char *path);
201
202#include <vector>
203
204struct EnvPaths
205{
206 const gchar *env_name;
207 const gchar *env_path;
208 gboolean modifiable;
209};
210
211
217std::vector<EnvPaths> gnc_list_all_paths ();
218
219#endif
220
221#endif /* GNC_FILEPATH_UTILS_H */
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_file_path_relative_part(const gchar *prefix, const gchar *path)
Given a prefix and a path return the relative portion of the path.
char * gnc_filepath_init(void)
Initializes the gnucash user data directory.
gchar * gnc_build_reports_path(const gchar *dirname)
Make a path to dirname in the reports directory.
gchar * gnc_build_data_path(const gchar *filename)
Make a path to filename in the data subdirectory of the user's configuration directory.
gchar * gnc_build_translog_path(const gchar *filename)
Make a path to filename in the translog subdirectory of the user's configuration directory.
const gchar * gnc_userdata_dir(void)
Ensure that the user's configuration directory exists and is minimally populated.
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_userconfig_path(const gchar *filename)
Make a path to filename in the user's configuration directory.
gchar * gnc_build_book_path(const gchar *filename)
Make a path to filename in the book subdirectory of the user's configuration directory.
gchar * gnc_build_report_path(const gchar *filename)
Make a path to filename in the report directory.
gchar * gnc_build_scm_path(const gchar *filename)
Make a path to filename in the scm directory.
const gchar * gnc_userconfig_dir(void)
Return the user's config directory for gnucash.
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_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_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_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.
gchar * gnc_build_stdreports_path(const gchar *filename)
Make a path to filename in the standard reports 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.
gchar * gnc_build_userdata_path(const gchar *filename)
Make a path to filename in the user's gnucash data directory.