Laxkit
0.0.7.1
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
lax
fileutils.h
1
//
2
//
3
// The Laxkit, a windowing toolkit
4
// Please consult http://laxkit.sourceforge.net about where to send any
5
// correspondence about this software.
6
//
7
// This library is free software; you can redistribute it and/or
8
// modify it under the terms of the GNU Library General Public
9
// License as published by the Free Software Foundation; either
10
// version 2 of the License, or (at your option) any later version.
11
//
12
// This library is distributed in the hope that it will be useful,
13
// but WITHOUT ANY WARRANTY; without even the implied warranty of
14
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
// Library General Public License for more details.
16
//
17
// You should have received a copy of the GNU Library General Public
18
// License along with this library; if not, write to the Free Software
19
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20
//
21
// Copyright (C) 2004-2007 by Tom Lechner
22
//
23
#ifndef _LAX_FILEUTILS_H
24
#define _LAX_FILEUTILS_H
25
26
#include <cstdio>
27
#include <sys/stat.h>
28
29
namespace
LaxFiles {
30
31
int
how_indented
(
char
*str,
char
**strt=NULL);
32
int
getline_indent_nonblank
(
char
**line,
size_t
*n,FILE *f,
int
indent,
33
const
char
*comment,
char
quote=
'"'
,
char
skiplines=1,
int
*lineindent=NULL);
34
int
cut_comment
(
char
*str,
const
char
*cm=
"#"
,
char
quote=
'"'
);
35
int
is_good_filename
(
const
char
*filename);
36
int
check_dirs
(
const
char
*dirs,
char
make_too);
37
int
lax_stat
(
const
char
*file,
int
followlink,
struct
stat *buf);
38
int
file_exists
(
const
char
*filename,
int
followlink,
int
*error);
39
long
file_size
(
const
char
*filename,
int
followlink,
int
*error);
40
char
*
sanitize_filename
(
char
*filename,
int
makedup);
41
int
readable_file
(
const
char
*filename,FILE **ff=NULL);
42
char
*
full_path_for_file
(
const
char
*file,
const
char
*path);
43
char
*
convert_to_full_path
(
char
*&file,
const
char
*path);
44
char
*
relative_file
(
const
char
*file,
const
char
*relativeto,
char
isdir);
45
int
is_in_subdir
(
const
char
*file,
const
char
*dir);
46
char
*
file_to_uri
(
const
char
*file);
47
char
*
expand_home
(
const
char
*file);
48
char
*
expand_home_inplace
(
char
*&file);
49
char
*
simplify_path
(
char
*file,
int
modorig=0);
50
char
*
make_filename_base
(
const
char
*f);
51
//void get_path_parts(const char *f,const char **dir,const char **file);
52
char
*
read_in_whole_file
(
const
char
*file,
int
*chars_ret,
int
maxchars=0);
53
54
char
*
get_bookmarks
(
const
char
*file,
const
char
*filetype);
55
56
#ifdef _LAX_PLATFORM_MAC
57
int
getline(
char
**line,
size_t
*n,FILE *f);
58
#endif //_LAX_PLATFORM_MAC
59
60
}
//namespace LaxFiles
61
62
#endif
63
Mon Feb 17 2014 11:52:56, Laxkit