From 3475995f3934eec908ac42e1de744c317ea326f3 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 31 Oct 2015 11:51:14 -0400 Subject: [PATCH] ColType*: Added Duration, String and Numeric type base classes --- src/columns/CMakeLists.txt | 5 ++- src/columns/ColTypeDate.h | 4 +-- src/columns/ColTypeDuration.cpp | 55 +++++++++++++++++++++++++++++++++ src/columns/ColTypeDuration.h | 47 ++++++++++++++++++++++++++++ src/columns/ColTypeNumeric.cpp | 55 +++++++++++++++++++++++++++++++++ src/columns/ColTypeNumeric.h | 47 ++++++++++++++++++++++++++++ src/columns/ColTypeString.cpp | 55 +++++++++++++++++++++++++++++++++ src/columns/ColTypeString.h | 47 ++++++++++++++++++++++++++++ 8 files changed, 312 insertions(+), 3 deletions(-) create mode 100644 src/columns/ColTypeDuration.cpp create mode 100644 src/columns/ColTypeDuration.h create mode 100644 src/columns/ColTypeNumeric.cpp create mode 100644 src/columns/ColTypeNumeric.h create mode 100644 src/columns/ColTypeString.cpp create mode 100644 src/columns/ColTypeString.h diff --git a/src/columns/CMakeLists.txt b/src/columns/CMakeLists.txt index b4bc014ea..76ccdc0fc 100644 --- a/src/columns/CMakeLists.txt +++ b/src/columns/CMakeLists.txt @@ -6,7 +6,6 @@ include_directories (${CMAKE_SOURCE_DIR} ${TASK_INCLUDE_DIRS}) set (columns_SRCS Column.cpp Column.h - ColTypeDate.cpp ColTypeDate.h ColDepends.cpp ColDepends.h ColDescription.cpp ColDescription.h ColDue.cpp ColDue.h @@ -24,6 +23,10 @@ set (columns_SRCS Column.cpp Column.h ColStatus.cpp ColStatus.h ColString.cpp ColString.h ColTags.cpp ColTags.h + ColTypeDate.cpp ColTypeDate.h + ColTypeDuration.cpp ColTypeDuration.h + ColTypeNumeric.cpp ColTypeNumeric.h + ColTypeString.cpp ColTypeString.h ColUntil.cpp ColUntil.h ColUrgency.cpp ColUrgency.h ColUDA.cpp ColUDA.h diff --git a/src/columns/ColTypeDate.h b/src/columns/ColTypeDate.h index 7d3885900..74d618ef5 100644 --- a/src/columns/ColTypeDate.h +++ b/src/columns/ColTypeDate.h @@ -24,8 +24,8 @@ // //////////////////////////////////////////////////////////////////////////////// -#ifndef INCLUDED_COLDATE -#define INCLUDED_COLDATE +#ifndef INCLUDED_COLTYPEDATE +#define INCLUDED_COLTYPEDATE #include #include diff --git a/src/columns/ColTypeDuration.cpp b/src/columns/ColTypeDuration.cpp new file mode 100644 index 000000000..1fdeba27f --- /dev/null +++ b/src/columns/ColTypeDuration.cpp @@ -0,0 +1,55 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// http://www.opensource.org/licenses/mit-license.php +// +//////////////////////////////////////////////////////////////////////////////// + +#include +#include + +//////////////////////////////////////////////////////////////////////////////// +ColumnTypeDuration::ColumnTypeDuration () +{ +} + +//////////////////////////////////////////////////////////////////////////////// +ColumnTypeDuration::~ColumnTypeDuration () +{ +} + +//////////////////////////////////////////////////////////////////////////////// +// Set the minimum and maximum widths for the value. +void ColumnTypeDuration::measure (Task& task, unsigned int& minimum, unsigned int& maximum) +{ +} + +//////////////////////////////////////////////////////////////////////////////// +void ColumnTypeDuration::render ( + std::vector & lines, + Task& task, + int width, + Color& color) +{ +} + +//////////////////////////////////////////////////////////////////////////////// diff --git a/src/columns/ColTypeDuration.h b/src/columns/ColTypeDuration.h new file mode 100644 index 000000000..aabe91658 --- /dev/null +++ b/src/columns/ColTypeDuration.h @@ -0,0 +1,47 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// http://www.opensource.org/licenses/mit-license.php +// +//////////////////////////////////////////////////////////////////////////////// + +#ifndef INCLUDED_COLTYPEDURATION +#define INCLUDED_COLTYPEDURATION + +#include +#include +#include +#include +#include + +class ColumnTypeDuration : public Column +{ +public: + ColumnTypeDuration (); + virtual ~ColumnTypeDuration (); + + virtual void measure (Task&, unsigned int&, unsigned int&); + virtual void render (std::vector &, Task&, int, Color&); +}; + +#endif +//////////////////////////////////////////////////////////////////////////////// diff --git a/src/columns/ColTypeNumeric.cpp b/src/columns/ColTypeNumeric.cpp new file mode 100644 index 000000000..51b6dc6db --- /dev/null +++ b/src/columns/ColTypeNumeric.cpp @@ -0,0 +1,55 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// http://www.opensource.org/licenses/mit-license.php +// +//////////////////////////////////////////////////////////////////////////////// + +#include +#include + +//////////////////////////////////////////////////////////////////////////////// +ColumnTypeNumeric::ColumnTypeNumeric () +{ +} + +//////////////////////////////////////////////////////////////////////////////// +ColumnTypeNumeric::~ColumnTypeNumeric () +{ +} + +//////////////////////////////////////////////////////////////////////////////// +// Set the minimum and maximum widths for the value. +void ColumnTypeNumeric::measure (Task& task, unsigned int& minimum, unsigned int& maximum) +{ +} + +//////////////////////////////////////////////////////////////////////////////// +void ColumnTypeNumeric::render ( + std::vector & lines, + Task& task, + int width, + Color& color) +{ +} + +//////////////////////////////////////////////////////////////////////////////// diff --git a/src/columns/ColTypeNumeric.h b/src/columns/ColTypeNumeric.h new file mode 100644 index 000000000..ff362171d --- /dev/null +++ b/src/columns/ColTypeNumeric.h @@ -0,0 +1,47 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// http://www.opensource.org/licenses/mit-license.php +// +//////////////////////////////////////////////////////////////////////////////// + +#ifndef INCLUDED_COLTYPENUMERIC +#define INCLUDED_COLTYPENUMERIC + +#include +#include +#include +#include +#include + +class ColumnTypeNumeric : public Column +{ +public: + ColumnTypeNumeric (); + virtual ~ColumnTypeNumeric (); + + virtual void measure (Task&, unsigned int&, unsigned int&); + virtual void render (std::vector &, Task&, int, Color&); +}; + +#endif +//////////////////////////////////////////////////////////////////////////////// diff --git a/src/columns/ColTypeString.cpp b/src/columns/ColTypeString.cpp new file mode 100644 index 000000000..4f2b120c4 --- /dev/null +++ b/src/columns/ColTypeString.cpp @@ -0,0 +1,55 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// http://www.opensource.org/licenses/mit-license.php +// +//////////////////////////////////////////////////////////////////////////////// + +#include +#include + +//////////////////////////////////////////////////////////////////////////////// +ColumnTypeString::ColumnTypeString () +{ +} + +//////////////////////////////////////////////////////////////////////////////// +ColumnTypeString::~ColumnTypeString () +{ +} + +//////////////////////////////////////////////////////////////////////////////// +// Set the minimum and maximum widths for the value. +void ColumnTypeString::measure (Task& task, unsigned int& minimum, unsigned int& maximum) +{ +} + +//////////////////////////////////////////////////////////////////////////////// +void ColumnTypeString::render ( + std::vector & lines, + Task& task, + int width, + Color& color) +{ +} + +//////////////////////////////////////////////////////////////////////////////// diff --git a/src/columns/ColTypeString.h b/src/columns/ColTypeString.h new file mode 100644 index 000000000..3ba2af4fc --- /dev/null +++ b/src/columns/ColTypeString.h @@ -0,0 +1,47 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// http://www.opensource.org/licenses/mit-license.php +// +//////////////////////////////////////////////////////////////////////////////// + +#ifndef INCLUDED_COLTYPESTRING +#define INCLUDED_COLTYPESTRING + +#include +#include +#include +#include +#include + +class ColumnTypeString : public Column +{ +public: + ColumnTypeString (); + virtual ~ColumnTypeString (); + + virtual void measure (Task&, unsigned int&, unsigned int&); + virtual void render (std::vector &, Task&, int, Color&); +}; + +#endif +////////////////////////////////////////////////////////////////////////////////