18 #include <boost/filesystem.hpp> 19 #include <boost/test/unit_test.hpp> 21 namespace bfs = boost::filesystem;
30 void set(
const std::string& content)
34 const auto mode = std::ios_base::out;
35 stream.open(
path, std::ios_base::trunc | mode);
36 auto permission = (bfs::perms::owner_read | bfs::perms::owner_write);
37 bfs::permissions(
path, permission);
50 const bfs::path path = bfs::unique_path(
"%%%%-%%%%-%%%%-%%%%-%%%%-%%%%.tmp.out");
70 BOOST_CHECK_EQUAL(config_a, config_b);
void remove()
Removes a tip.
Tool to check if two WML string are equivalent.
void check_wml_equivalence(const std::string &a, const std::string &b)
Assert two WML strings are equivalent.
bool exists(const image::locator &i_locator)
Returns true if the given image actually exists, without loading it.
void read(config &cfg, std::istream &in, abstract_validator *validator)
void set(const std::string &content)
Set file to content and close the file.
Self destructive temporary file at the current directory.
const bfs::path path
Path to the temporary file.
std::map< std::string, struct preproc_define > preproc_map
A config object defines a single node in a WML file, with access to child nodes.
filesystem::scoped_istream preprocess_file(const std::string &fname, preproc_map *defines)
Function to use the WML preprocessor on a file.
config preprocess_and_parse(const std::string &wml_str, preproc_map *macro_map)
Make a syntax tree by preprocessing and parsing a WML string.