From 5ba1fd6aebb1fd965dde518515d320b027d55ccf Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 16 May 2009 21:56:54 -0400 Subject: [PATCH] FF4 - New Duration object - Replaces convertDuration. --- src/{rewrite => }/Duration.cpp | 0 src/{rewrite => }/Duration.h | 0 src/Makefile.am | 2 +- src/Makefile.in | 10 +++-- src/rewrite/Date.cpp | 69 ---------------------------------- src/rewrite/Date.h | 49 ------------------------ 6 files changed, 7 insertions(+), 123 deletions(-) rename src/{rewrite => }/Duration.cpp (100%) rename src/{rewrite => }/Duration.h (100%) delete mode 100644 src/rewrite/Date.cpp delete mode 100644 src/rewrite/Date.h diff --git a/src/rewrite/Duration.cpp b/src/Duration.cpp similarity index 100% rename from src/rewrite/Duration.cpp rename to src/Duration.cpp diff --git a/src/rewrite/Duration.h b/src/Duration.h similarity index 100% rename from src/rewrite/Duration.h rename to src/Duration.h diff --git a/src/Makefile.am b/src/Makefile.am index 1d898a521..baff7fbb1 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,2 +1,2 @@ bin_PROGRAMS = task -task_SOURCES = Config.cpp Date.cpp T.cpp TDB.cpp Table.cpp Grid.cpp Timer.cpp color.cpp parse.cpp task.cpp command.cpp edit.cpp report.cpp util.cpp text.cpp rules.cpp import.cpp Config.h Date.h T.h TDB.h Table.h Grid.h Timer.h color.h task.h +task_SOURCES = Config.cpp Date.cpp T.cpp TDB.cpp Table.cpp Grid.cpp Timer.cpp Duration.cpp color.cpp parse.cpp task.cpp command.cpp edit.cpp report.cpp util.cpp text.cpp rules.cpp import.cpp Config.h Date.h T.h TDB.h Table.h Grid.h Timer.h Duration.h color.h task.h diff --git a/src/Makefile.in b/src/Makefile.in index ea3982dc4..a883c69a0 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -45,9 +45,10 @@ binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) am_task_OBJECTS = Config.$(OBJEXT) Date.$(OBJEXT) T.$(OBJEXT) \ TDB.$(OBJEXT) Table.$(OBJEXT) Grid.$(OBJEXT) Timer.$(OBJEXT) \ - color.$(OBJEXT) parse.$(OBJEXT) task.$(OBJEXT) \ - command.$(OBJEXT) edit.$(OBJEXT) report.$(OBJEXT) \ - util.$(OBJEXT) text.$(OBJEXT) rules.$(OBJEXT) import.$(OBJEXT) + Duration.$(OBJEXT) color.$(OBJEXT) parse.$(OBJEXT) \ + task.$(OBJEXT) command.$(OBJEXT) edit.$(OBJEXT) \ + report.$(OBJEXT) util.$(OBJEXT) text.$(OBJEXT) rules.$(OBJEXT) \ + import.$(OBJEXT) task_OBJECTS = $(am_task_OBJECTS) task_LDADD = $(LDADD) DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@ @@ -155,7 +156,7 @@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -task_SOURCES = Config.cpp Date.cpp T.cpp TDB.cpp Table.cpp Grid.cpp Timer.cpp color.cpp parse.cpp task.cpp command.cpp edit.cpp report.cpp util.cpp text.cpp rules.cpp import.cpp Config.h Date.h T.h TDB.h Table.h Grid.h Timer.h color.h task.h +task_SOURCES = Config.cpp Date.cpp T.cpp TDB.cpp Table.cpp Grid.cpp Timer.cpp Duration.cpp color.cpp parse.cpp task.cpp command.cpp edit.cpp report.cpp util.cpp text.cpp rules.cpp import.cpp Config.h Date.h T.h TDB.h Table.h Grid.h Timer.h Duration.h color.h task.h all: all-am .SUFFIXES: @@ -224,6 +225,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Config.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Date.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Duration.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Grid.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/T.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TDB.Po@am__quote@ diff --git a/src/rewrite/Date.cpp b/src/rewrite/Date.cpp deleted file mode 100644 index ad761b2a6..000000000 --- a/src/rewrite/Date.cpp +++ /dev/null @@ -1,69 +0,0 @@ -//////////////////////////////////////////////////////////////////////////////// -// task - a command line task list manager. -// -// Copyright 2006 - 2009, Paul Beckingham. -// All rights reserved. -// -// This program is free software; you can redistribute it and/or modify it under -// the terms of the GNU General Public License as published by the Free Software -// Foundation; either version 2 of the License, or (at your option) any later -// version. -// -// This program is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -// details. -// -// You should have received a copy of the GNU General Public License along with -// this program; if not, write to the -// -// Free Software Foundation, Inc., -// 51 Franklin Street, Fifth Floor, -// Boston, MA -// 02110-1301 -// USA -// -//////////////////////////////////////////////////////////////////////////////// - -#include "Date.h" - -//////////////////////////////////////////////////////////////////////////////// -Date::Date () -{ -} - -//////////////////////////////////////////////////////////////////////////////// -Date::Date (const Date& other) -{ - throw std::string ("unimplemented Date::Date"); - mTime = other.mTime; -} - -//////////////////////////////////////////////////////////////////////////////// -Date& Date::operator= (const Date& other) -{ - throw std::string ("unimplemented Date::operator="); - if (this != &other) - { - mTime = other.mTime; - } - - return *this; -} - -//////////////////////////////////////////////////////////////////////////////// -Date::~Date () -{ -} - -//////////////////////////////////////////////////////////////////////////////// -// TODO Support m/d/y -// TODO Support ISO-??? -// TODO Support time_t -// TODO Relative dates (today, tomorrow, yesterday, +1d, -2w, eow, eom, eoy) -void Date::parse (const std::string& input) -{ - throw std::string ("unimplemented Date::parse"); -} - -//////////////////////////////////////////////////////////////////////////////// diff --git a/src/rewrite/Date.h b/src/rewrite/Date.h deleted file mode 100644 index 935367ae0..000000000 --- a/src/rewrite/Date.h +++ /dev/null @@ -1,49 +0,0 @@ -//////////////////////////////////////////////////////////////////////////////// -// task - a command line task list manager. -// -// Copyright 2006 - 2009, Paul Beckingham. -// All rights reserved. -// -// This program is free software; you can redistribute it and/or modify it under -// the terms of the GNU General Public License as published by the Free Software -// Foundation; either version 2 of the License, or (at your option) any later -// version. -// -// This program is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -// details. -// -// You should have received a copy of the GNU General Public License along with -// this program; if not, write to the -// -// Free Software Foundation, Inc., -// 51 Franklin Street, Fifth Floor, -// Boston, MA -// 02110-1301 -// USA -// -//////////////////////////////////////////////////////////////////////////////// -#ifndef INCLUDED_DATE -#define INCLUDED_DATE - -#include -#include - -class Date -{ -public: - Date (); // Default constructor - Date (const Date&); // Copy constructor - Date (time_t); // Copy constructor - Date& operator= (const Date&); // Assignment operator - ~Date (); // Destructor - - void parse (const std::string&); - -private: - time_t mTime; -}; - -#endif -////////////////////////////////////////////////////////////////////////////////