summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrandomdan <randomdan@localhost>2010-12-29 21:59:54 +0000
committerrandomdan <randomdan@localhost>2010-12-29 21:59:54 +0000
commite375384b754bf1044a38628d840909ea29880f7b (patch)
tree0b9d2d176a0a37577a5c5e0be3f164c330d51188
parentFix row numbering in rowSets to behave as before (1 upwards, not 0 upwards) (diff)
downloadproject2-e375384b754bf1044a38628d840909ea29880f7b.tar.bz2
project2-e375384b754bf1044a38628d840909ea29880f7b.tar.xz
project2-e375384b754bf1044a38628d840909ea29880f7b.zip
Remove file create date for not being the create date
Add option for keeping the blank lines in file rows
-rw-r--r--project2/fileRows.cpp3
-rw-r--r--project2/fileRows.h1
-rw-r--r--project2/fsRows.cpp14
-rw-r--r--project2/fsRows.h1
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<Glib::ustring> 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);
}
@@ -281,16 +277,6 @@ FsRows::fileModDate() const
}
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
{
struct passwd * p = getpwuid(curStat.st_uid);
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;