filetools.hh
Go to the documentation of this file.
1 /* -*- mia-c++ -*-
2  *
3  * This file is part of MIA - a toolbox for medical image analysis
4  * Copyright (c) Leipzig, Madrid 1999-2017 Gert Wollny
5  *
6  * MIA is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with MIA; if not, see <http://www.gnu.org/licenses/>.
18  *
19  */
20 
21 #ifndef MIA_FILETOOLS_HH
22 #define MIA_FILETOOLS_HH
23 
24 #include <string>
25 #include <vector>
26 
27 #include <mia/core/defines.hh>
28 
29 namespace boost {
30 namespace filesystem {
31 class path;
32 }
33 }
34 
36 
46 EXPORT_CORE std::vector<std::string> get_consecutive_numbered_files(std::string const& in_filename);
47 
60 EXPORT_CORE const std::string get_filename_pattern_and_range(std::string const& in_filename, size_t& min, size_t& max, size_t& format_width);
61 
62 
73 EXPORT_CORE size_t fname_to_cformat(const char *fname, std::string& base, bool wildcard);
74 
75 
84 EXPORT_CORE std::string create_filename(const char *cformat, size_t num);
85 
93 EXPORT_CORE size_t get_filename_number_pattern_width(std::string const& in_filename);
94 
105 EXPORT_CORE size_t get_filename_number_pattern(std::string const& infilename, std::string& base, std::string& suffix);
106 
117 EXPORT_CORE void split_filename_number_pattern(std::string const& in_filename, std::string& base,
118  std::string& suffix, std::string& number);
119 
121 
122 #endif
EXPORT_CORE std::string create_filename(const char *cformat, size_t num)
EXPORT_CORE const std::string get_filename_pattern_and_range(std::string const &in_filename, size_t &min, size_t &max, size_t &format_width)
#define NS_MIA_BEGIN
conveniance define to start the mia namespace
Definition: defines.hh:33
EXPORT_CORE size_t get_filename_number_pattern(std::string const &infilename, std::string &base, std::string &suffix)
EXPORT_CORE std::vector< std::string > get_consecutive_numbered_files(std::string const &in_filename)
EXPORT_CORE void split_filename_number_pattern(std::string const &in_filename, std::string &base, std::string &suffix, std::string &number)
#define EXPORT_CORE
Macro to manage Visual C++ style dllimport/dllexport.
Definition: defines.hh:101
EXPORT_CORE size_t get_filename_number_pattern_width(std::string const &in_filename)
EXPORT_CORE size_t fname_to_cformat(const char *fname, std::string &base, bool wildcard)
#define NS_MIA_END
conveniance define to end the mia namespace
Definition: defines.hh:36