summaryrefslogtreecommitdiff
path: root/src/cstore/unionfs/cstore-unionfs.hpp
diff options
context:
space:
mode:
authorAn-Cheng Huang <ancheng@vyatta.com>2010-07-31 14:43:50 -0700
committerAn-Cheng Huang <ancheng@vyatta.com>2010-07-31 14:43:50 -0700
commitf7982ea06e89e816a61218e7fc6229f281cd57bc (patch)
treecd9a9c6675ec53b08017294a02da8741214b9557 /src/cstore/unionfs/cstore-unionfs.hpp
parentcfd1dd302b37feb9379092711e1f2f6208b19144 (diff)
downloadvyatta-cfg-f7982ea06e89e816a61218e7fc6229f281cd57bc.tar.gz
vyatta-cfg-f7982ea06e89e816a61218e7fc6229f281cd57bc.zip
handle potential exceptions from filesystem operations.
Diffstat (limited to 'src/cstore/unionfs/cstore-unionfs.hpp')
-rw-r--r--src/cstore/unionfs/cstore-unionfs.hpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/cstore/unionfs/cstore-unionfs.hpp b/src/cstore/unionfs/cstore-unionfs.hpp
index 2da148e..b0e7201 100644
--- a/src/cstore/unionfs/cstore-unionfs.hpp
+++ b/src/cstore/unionfs/cstore-unionfs.hpp
@@ -210,6 +210,17 @@ private:
bool read_whole_file(const b_fs::path& file, string& data);
bool committed_marker_exists(const string& marker);
void recursive_copy_dir(const b_fs::path& src, const b_fs::path& dst);
+
+ // boost fs operations wrappers
+ bool b_fs_exists(const b_fs::path& path) {
+ try { return b_fs::exists(path); } catch (...) { return false; }
+ };
+ bool b_fs_is_directory(const b_fs::path& path) {
+ try { return b_fs::is_directory(path); } catch (...) { return false; }
+ };
+ bool b_fs_is_regular(const b_fs::path& path) {
+ try { return b_fs::is_regular(path); } catch (...) { return false; }
+ };
};
#endif /* _CSTORE_UNIONFS_H_ */