Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reorganize CoolPropTools.h into smaller modules #982

Merged
merged 7 commits into from
Feb 23, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions include/CPfilepaths.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#ifndef COOLPROP_FILE_PATH_H
#define COOLPROP_FILE_PATH_H

#include <string>
#include <vector>

/// Get the user's home directory; It is believed that is is always a place that files can be written
std::string get_home_dir(void);

/// Return true if path exists
bool path_exists(const std::string &path);

/// Make directory and all required intermediate directories
void make_dirs(std::string file_path);

/// Get the size of a directory in bytes
#if defined(__ISWINDOWS__)
unsigned long long CalculateDirSize(const std::wstring &path, std::vector<std::wstring> *errVect = NULL);
#else
unsigned long long CalculateDirSize(const std::string &path);
#endif

// Get all the contents of a file and dump into a STL string
// Thanks to http://stackoverflow.com/questions/2602013/read-whole-ascii-file-into-c-stdstring
std::string get_file_contents(const char *filename);

/// Get all the contents of a binary file
std::vector<char> get_binary_file_contents(const char *filename);

#endif
Loading