1
0
mirror of https://github.com/pdf2htmlEX/pdf2htmlEX.git synced 2024-09-16 04:46:03 +00:00
pdf2htmlEX/src/util/path.h

44 lines
1.0 KiB
C
Raw Normal View History

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);
/**
* 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.
*
* @param filename the filename to be sanitized.
*
* @return the sanitized filename.
*/
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);
2012-11-29 10:16:05 +00:00
} //namespace pdf2htmlEX
#endif //PATH_H__