From e375384b754bf1044a38628d840909ea29880f7b Mon Sep 17 00:00:00 2001 From: randomdan Date: Wed, 29 Dec 2010 21:59:54 +0000 Subject: Remove file create date for not being the create date Add option for keeping the blank lines in file rows --- project2/fileRows.cpp | 3 ++- project2/fileRows.h | 1 + project2/fsRows.cpp | 14 -------------- project2/fsRows.h | 1 - 4 files changed, 3 insertions(+), 16 deletions(-) diff --git a/project2/fileRows.cpp b/project2/fileRows.cpp index b7d0c7e..7251a9f 100644 --- a/project2/fileRows.cpp +++ b/project2/fileRows.cpp @@ -11,6 +11,7 @@ FileRows::FileRows(const xmlpp::Element * p) : path(p->get_attribute_value("path")), fieldSep(p->get_attribute_value("fieldSep")[0]), quoteChar(p->get_attribute_value("quoteChar")[0]), + keepBlankRows(p->get_attribute_value("keepBlankRows") == "true"), newline(p->get_attribute_value("newline")), encoding(p->get_attribute_value("encoding")) { @@ -101,7 +102,7 @@ FileRows::execute(const RowProcessor * rp) const curCol++; } } - if (!mkCols && !values.empty()) { + if (!mkCols && (keepBlankRows || !values.empty())) { while (values.size() < columns.size()) { values.push_back(ValPtr(new Glib::ustring())); curCol++; diff --git a/project2/fileRows.h b/project2/fileRows.h index 6f06d59..3ed9211 100644 --- a/project2/fileRows.h +++ b/project2/fileRows.h @@ -39,6 +39,7 @@ class FileRows : public RowSet { private: gunichar fieldSep; gunichar quoteChar; + bool keepBlankRows; std::string newline; std::string encoding; typedef std::vector Columns; diff --git a/project2/fsRows.cpp b/project2/fsRows.cpp index 29f6ed9..2ee72ac 100644 --- a/project2/fsRows.cpp +++ b/project2/fsRows.cpp @@ -21,7 +21,6 @@ const Glib::ustring field_absPath("absPath"); const Glib::ustring field_relPath("relPath"); const Glib::ustring field_size("size"); const Glib::ustring field_modDate("modifiedDate"); -const Glib::ustring field_createDate("createdDate"); const Glib::ustring field_user("owningUser"); const Glib::ustring field_group("owningGroup"); const Glib::ustring field_mode("mode"); @@ -237,9 +236,6 @@ FsRows::resolveAttr(const Glib::ustring & a) const if (a == field_modDate) { return boost::bind(&FsRows::fileModDate, this); } - if (a == field_createDate) { - return boost::bind(&FsRows::fileCreateDate, this); - } if (a == field_user) { return boost::bind(&FsRows::fileUser, this); } @@ -280,16 +276,6 @@ FsRows::fileModDate() const return Glib::ustring(buf); } -VariableType -FsRows::fileCreateDate() const -{ - char buf[40]; - struct tm tm; - gmtime_r(&curStat.st_ctime, &tm); - strftime(buf, sizeof(buf), "%F %T", &tm); - return Glib::ustring(buf); -} - VariableType FsRows::fileUser() const { diff --git a/project2/fsRows.h b/project2/fsRows.h index 08b17c5..7e8c3ce 100644 --- a/project2/fsRows.h +++ b/project2/fsRows.h @@ -43,7 +43,6 @@ class FsRows : public RowSet { VariableType fileRelPath() const; VariableType fileSize() const; VariableType fileModDate() const; - VariableType fileCreateDate() const; VariableType fileUser() const; VariableType fileGroup() const; VariableType fileMode() const; -- cgit v1.2.3