file_utils.h 1.66 KB
Newer Older
1 2 3
/**
 * file_utils.h - file utilities for SciteProj
 *
4
 *  Copyright 2009-2017 Andreas Rönnquist
5 6
 *
 * This file is part of SciteProj.
7
 *
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
 * SciteProj is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * SciteProj is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with SciteProj.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
#ifndef __HEADER_FILE_UTILS_
#define __HEADER_FILE_UTILS_

/*
 *
 */
extern gchar *current_directory;
29

30 31 32 33 34 35 36 37 38
/*
 *
 */
void init_file_utils();
gchar *fix_path(gchar *base_dir,gchar *original);
gboolean is_separator(gchar ch);

gchar *fix_separators(gchar *source);

39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
// get the filename from a full path+filename
gchar *get_filename_from_full_path(gchar *src);

// Convert an absolute file path to a relative file path
gboolean abs_path_to_relative_path(const gchar *absPath, gchar **relativePath, const gchar *basePath, GError **err);

// Convert a relative file path to an absolute file path
gboolean relative_path_to_abs_path(gchar *relativePath, gchar **absPath, const gchar *basePath, GError **err);

gchar *get_file_extension(gchar *filename);

int get_number_of_files_in_folder(gchar *folder_name);

gboolean is_string_folder(gchar *instring);

gchar *clean_folder(gchar *folder_name);
55 56

#endif /*__HEADER_FILE_UTILS_*/