2012-11-29 10:16:05 +00:00
|
|
|
/*
|
|
|
|
* Function handling filenames and paths
|
|
|
|
*
|
|
|
|
* by WangLu
|
|
|
|
* 2012.11.29
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef PATH_H__
|
|
|
|
#define PATH_H__
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
namespace pdf2htmlEX {
|
|
|
|
|
2012-11-29 11:43:19 +00:00
|
|
|
void create_directories(const std::string & path);
|
2012-11-29 10:16:05 +00:00
|
|
|
|
|
|
|
bool is_truetype_suffix(const std::string & suffix);
|
|
|
|
|
|
|
|
std::string get_filename(const std::string & path);
|
|
|
|
std::string get_suffix(const std::string & path);
|
|
|
|
|
2013-03-17 05:08:06 +00:00
|
|
|
/**
|
2013-03-18 06:39:02 +00:00
|
|
|
* Sanitize all occurrences of '%' except for the first valid format specifier. Filename
|
|
|
|
* is only sanitized if a formatter is found, and the function returns true.
|
2013-03-17 05:08:06 +00:00
|
|
|
*
|
2013-03-18 06:39:02 +00:00
|
|
|
* @param filename the filename to be sanitized. Value will be modified.
|
2013-03-17 05:08:06 +00:00
|
|
|
*
|
2013-03-18 06:39:02 +00:00
|
|
|
* @return true if a format specifier was found, false otherwise.
|
2013-03-17 05:08:06 +00:00
|
|
|
*/
|
2013-03-18 06:39:02 +00:00
|
|
|
bool sanitize_filename(std::string & filename);
|
2013-03-17 05:08:06 +00:00
|
|
|
|
2012-11-29 10:16:05 +00:00
|
|
|
} //namespace pdf2htmlEX
|
|
|
|
#endif //PATH_H__
|