diff options
author | randomdan <randomdan@localhost> | 2011-06-28 18:06:08 +0000 |
---|---|---|
committer | randomdan <randomdan@localhost> | 2011-06-28 18:06:08 +0000 |
commit | 6354f396fe144431e8ae08cbeb64e96cf683d708 (patch) | |
tree | c4e28b0b8f4defb4fa696a0c448b4b3c0bf784a9 | |
parent | Remove unneeded #include which required ODBC to be install (diff) | |
download | project2-6354f396fe144431e8ae08cbeb64e96cf683d708.tar.bz2 project2-6354f396fe144431e8ae08cbeb64e96cf683d708.tar.xz project2-6354f396fe144431e8ae08cbeb64e96cf683d708.zip |
Build fsRows against both versions 2 and 3 of boost::filesystem
Fix 64bit compat issue in fileStrmVarWriter
-rw-r--r-- | project2/fileStrmVarWriter.cpp | 4 | ||||
-rw-r--r-- | project2/fsRows.cpp | 5 |
2 files changed, 7 insertions, 2 deletions
diff --git a/project2/fileStrmVarWriter.cpp b/project2/fileStrmVarWriter.cpp index f2c8d7f..8f3ca5c 100644 --- a/project2/fileStrmVarWriter.cpp +++ b/project2/fileStrmVarWriter.cpp @@ -49,10 +49,10 @@ void FileStreamVariableWriter::operator()(const double & i) const { fprintf(out, "%g", i); } void FileStreamVariableWriter::operator()(const Glib::ustring & i) const { - fprintf(out, "'%.*s'", i.bytes(), i.c_str()); + fwrite(i.c_str(), i.bytes(), 1, out); } void FileStreamVariableWriter::operator()(const boost::shared_ptr<const Glib::ustring> & i) const { - fprintf(out, "'%.*s'", i->bytes(), i->c_str()); + fwrite(i->c_str(), i->bytes(), 1, out); } void FileStreamVariableWriter::operator()(const boost::posix_time::ptime & i) const { fprintf(out, "[%s]", boost::posix_time::to_iso_extended_string(i).c_str()); diff --git a/project2/fsRows.cpp b/project2/fsRows.cpp index 868eaa7..5ae8221 100644 --- a/project2/fsRows.cpp +++ b/project2/fsRows.cpp @@ -13,6 +13,7 @@ #include <grp.h> #include <stdio.h> #include <boost/date_time/posix_time/posix_time.hpp> +#include <boost/version.hpp> typedef boost::filesystem::directory_iterator DirEnt; @@ -41,7 +42,11 @@ class FsRowSpecName : public FsRows::SpecBase { // Based on code written by Jack Handy - jakkhandy@hotmail.com // from http://www.codeproject.com/KB/string/wildcmp.aspx Glib::ustring::const_iterator wild = pattern.begin(); +#if BOOST_VERSION >= 104500 Glib::ustring leaf(curPath(fs).leaf().string()); +#else + Glib::ustring leaf(curPath(fs).leaf()); +#endif Glib::ustring::const_iterator string = leaf.begin(); while ((string != leaf.end()) && (*wild != '*')) { |