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 04:31:43 +00:00
|
|
|
* Function to sanitize a filename so that it can be eventually safely used in a printf
|
|
|
|
* statement. Allows a single %d placeholder, but no other format specifiers.
|
2013-03-17 05:08:06 +00:00
|
|
|
*
|
|
|
|
* @param filename the filename to be sanitized.
|
|
|
|
*
|
|
|
|
* @return the sanitized filename.
|
|
|
|
*/
|
2013-03-18 04:31:43 +00:00
|
|
|
std::string sanitize_filename(const std::string & filename);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function to check if a filename contains at least one %d integer placeholder
|
|
|
|
* for use in a printf statement.
|
|
|
|
*
|
|
|
|
* @param filename the filename to check
|
|
|
|
*
|
|
|
|
* @return true if the filename contains an integer placeholder, false otherwise.
|
|
|
|
*/
|
|
|
|
bool contains_integer_placeholder(const std::string & filename);
|
2013-03-17 05:08:06 +00:00
|
|
|
|
2012-11-29 10:16:05 +00:00
|
|
|
} //namespace pdf2htmlEX
|
|
|
|
#endif //PATH_H__
|