Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

31 lines (25 sloc) 0.492 kB
#ifndef _TMPDIR_H
#define _TMPDIR_H
#include <boost/filesystem.hpp>
#include <string>
struct TmpDir
{
boost::filesystem::path dir;
bool created;
TmpDir(const boost::filesystem::path &_dir) : dir(_dir), created(false) {}
~TmpDir()
{
if(created)
boost::filesystem::remove_all(dir);
}
std::string get(const std::string &file)
{
if(!created)
{
create_directory(dir);
created = true;
}
return (dir / file).string();
}
};
#endif
Jump to Line
Something went wrong with that request. Please try again.