From 37104d47a3ce5234ff708588b68e8d9cbd13131d Mon Sep 17 00:00:00 2001 From: jsdelfino Date: Mon, 4 Apr 2011 08:45:59 +0000 Subject: Add sample database and search components, sample apps and corresponding test cases, and minor refactoring of component categories. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1088507 13f79535-47bb-0310-9956-ffa450edef68 --- sca-cpp/trunk/components/filedb/filedb.hpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'sca-cpp/trunk/components/filedb') diff --git a/sca-cpp/trunk/components/filedb/filedb.hpp b/sca-cpp/trunk/components/filedb/filedb.hpp index b5690d0f1b..d368522669 100644 --- a/sca-cpp/trunk/components/filedb/filedb.hpp +++ b/sca-cpp/trunk/components/filedb/filedb.hpp @@ -165,7 +165,9 @@ const failable post(const value& key, const value& val, FileDB& db) { if (isList(key)) mkdirs(key, db.name); - ofstream os(filename(key, db.name)); + const string fn = filename(key, db.name); + debug(fn, "filedb::post::filename"); + ofstream os(fn); if (os.fail()) return mkfailure("Couldn't post file database entry."); const failable r = write(val, os, db.format, db); @@ -184,7 +186,9 @@ const failable put(const value& key, const value& val, FileDB& db) { if (isList(key)) mkdirs(key, db.name); - ofstream os(filename(key, db.name)); + const string fn = filename(key, db.name); + debug(fn, "filedb::put::filename"); + ofstream os(fn); if (os.fail()) return mkfailure("Couldn't put file database entry."); const failable r = write(val, os, db.format, db); @@ -218,7 +222,9 @@ const failable del(const value& key, FileDB& db) { debug(key, "filedb::delete::key"); debug(db.name, "filedb::delete::dbname"); - const int rc = unlink(c_str(filename(key, db.name))); + const string fn = filename(key, db.name); + debug(fn, "filedb::del::filename"); + const int rc = unlink(c_str(fn)); if (rc == -1) return mkfailure("Couldn't delete file database entry."); -- cgit v1.2.3