plastimatch
Loading...
Searching...
No Matches
path_util.h
Go to the documentation of this file.
1/* -----------------------------------------------------------------------
2 See COPYRIGHT.TXT and LICENSE.TXT for copyright and license information
3 ----------------------------------------------------------------------- */
4#ifndef _path_util_h_
5#define _path_util_h_
6
7#include "plmsys_config.h"
8#include <string>
9#include <stdio.h>
10
11#if (_WIN32)
12#define ISSLASH(c) (((c) == '/') || ((c) == '\\'))
13#else
14#define ISSLASH(c) ((c) == '/')
15#endif
16
17PLMSYS_API std::string basename (const std::string& fn);
18PLMSYS_API std::string dirname (const std::string& fn);
19PLMSYS_API int extension_is (const char* fname, const char* ext);
20PLMSYS_API int extension_is (const std::string& fname, const char* ext);
21PLMSYS_API void strip_extension (char* filename);
22PLMSYS_API std::string strip_extension (const std::string& filename);
24 const std::string& filename, const std::string& ext);
25PLMSYS_API void trim_trailing_slashes (char *pathname);
26PLMSYS_API std::string trim_trailing_slashes (const std::string& pathname);
27PLMSYS_API char* file_util_parent (const char *filename);
28PLMSYS_API std::string file_util_parent (const std::string& filename);
29PLMSYS_API char* file_util_dirname (const char *filename);
30PLMSYS_API std::string file_util_dirname_string (const char *filename);
31PLMSYS_API std::string strip_leading_dir (const std::string& fn);
32PLMSYS_API std::string compose_filename (const std::string& a,
33 const std::string& b);
34PLMSYS_API std::string compose_filename (const char *a, const char *b);
35PLMSYS_API std::string make_windows_slashes (const std::string& s);
36
37#endif
std::string compose_filename(const std::string &a, const std::string &b)
Definition path_util.cxx:182
std::string strip_extension_if(const std::string &filename, const std::string &ext)
Definition path_util.cxx:46
std::string make_windows_slashes(const std::string &s)
Definition path_util.cxx:188
std::string dirname(const std::string &fn)
Definition path_util.cxx:156
void strip_extension(char *filename)
Definition path_util.cxx:28
std::string basename(const std::string &fn)
Definition path_util.cxx:145
int extension_is(const char *fname, const char *ext)
Definition path_util.cxx:15
char * file_util_dirname(const char *filename)
Definition path_util.cxx:110
void trim_trailing_slashes(char *pathname)
Definition path_util.cxx:57
char * file_util_parent(const char *filename)
Definition path_util.cxx:74
std::string file_util_dirname_string(const char *filename)
Definition path_util.cxx:122
std::string strip_leading_dir(const std::string &fn)
Definition path_util.cxx:135
#define PLMSYS_API
Definition plmsys_config.h:19