[gnote] Remove boost filesystem dependency from directory.cpp
- From: Aurimas Černius <aurimasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnote] Remove boost filesystem dependency from directory.cpp
- Date: Fri, 29 Apr 2011 21:22:14 +0000 (UTC)
commit 06de9c9ad2719e996fd7170a625f6b32cf3494ec
Author: Aurimas Ä?ernius <aurisc4 gmail com>
Date: Wed Mar 30 23:11:43 2011 +0300
Remove boost filesystem dependency from directory.cpp
Use Glib replacements.
Requires 2.18 version of Glib and Glibmm.
src/sharp/directory.cpp | 13 ++-----------
1 files changed, 2 insertions(+), 11 deletions(-)
---
diff --git a/src/sharp/directory.cpp b/src/sharp/directory.cpp
index a01a0d2..072971a 100644
--- a/src/sharp/directory.cpp
+++ b/src/sharp/directory.cpp
@@ -26,9 +26,6 @@
-#include <boost/filesystem/convenience.hpp>
-#include <boost/filesystem/path.hpp>
-#include <boost/filesystem/operations.hpp>
#include <glibmm.h>
#include "sharp/directory.hpp"
@@ -69,8 +66,7 @@ namespace sharp {
bool directory_exists(const std::string & dir)
{
- boost::filesystem::path p(dir);
- return (exists(p) && is_directory(p));
+ return Glib::file_test(dir, Glib::FILE_TEST_EXISTS) && Glib::file_test(dir, Glib::FILE_TEST_IS_DIR);
}
void directory_copy(const Glib::RefPtr<Gio::File> & src,
@@ -113,12 +109,7 @@ namespace sharp {
bool directory_create(const std::string & dir)
{
- try {
- return boost::filesystem::create_directories(dir);
- }
- catch(...) {
- }
- return false;
+ return Gio::File::create_for_path(dir)->make_directory_with_parents();
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]