treelite
Functions
filesystem.h File Reference

Cross-platform wrapper for common filesystem functions. More...

#include <dmlc/logging.h>
#include <errno.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <libgen.h>
#include <cstring>
Include dependency graph for filesystem.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

std::string GetBasename (const std::string &path)
 extract the base name from a full path. The base name is defined as the component that follows the last '/' in the full path. More...
 
void HandleSystemError (const std::string &msg)
 
void CreateDirectoryIfNotExist (const char *dirpath)
 

Detailed Description

Cross-platform wrapper for common filesystem functions.

Copyright (c) 2017 by Contributors

Author
Philip Cho

Definition in file filesystem.h.

Function Documentation

std::string treelite::common::filesystem::GetBasename ( const std::string &  path)
inline

extract the base name from a full path. The base name is defined as the component that follows the last '/' in the full path.

GetBaseName("./food/bar.txt"); // returns bar.txt
Parameters
pathfull path

Definition at line 37 of file filesystem.h.