vocabtree  0.0.1
filesystem.cxx File Reference
#include "filesystem.hpp"
#include <sys/stat.h>
#include <fcntl.h>
#include <fstream>
#include <iomanip>
#include <boost/filesystem.hpp>
Include dependency graph for filesystem.cxx:

Go to the source code of this file.

Data Structures

struct  filesystem::cvmat_header
 

Namespaces

namespace  filesystem
 Provides useful wrappers around many filesystem related functionality, including reading writing certain common data structures as well as common operations (ex.
 

Functions

bool filesystem::file_exists (const std::string &name)
 Returns true if file exists at location, else returns false. More...
 
void filesystem::create_file_directory (const std::string &absfilepath)
 Recursively creates all directories if needed up to the specified file. More...
 
bool filesystem::write_cvmat (const std::string &fname, const cv::Mat &data)
 Writes a cv::Mat structure to the specified location. More...
 
bool filesystem::load_cvmat (const std::string &fname, cv::Mat &data)
 Loads a cv::Mat structure from the specified location. More...
 
bool filesystem::write_sparse_vector (const std::string &fname, const std::vector< std::pair< uint32_t, float > > &data)
 Writes the BoW feature to the specified location. More...
 
bool filesystem::load_sparse_vector (const std::string &fname, std::vector< std::pair< uint32_t, float > > &data)
 Loads the BoW feature from the specified location. More...
 
std::vector< std::string > filesystem::list_files (const std::string &path, const std::string &ext="", bool recursive=true)
 Lists all files in the given directory with an optional extension. More...
 
std::string filesystem::basename (const std::string &path, bool include_extension=false)
 Returns the basename of the input filepath, including or not including the extension. More...
 
bool filesystem::write_text (const std::string &fname, const std::string &text)
 Writes a text file to the input file location given the input string. More...