From d0c4326af32949e63ae3ea98cee0996eee1115d4 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 26 Jul 2015 12:22:02 -0400 Subject: [PATCH] Lexer: Upgraded attributes vector to a map of name to type --- src/Context.cpp | 3 +++ src/Lexer.cpp | 1 + src/Lexer.h | 1 + 3 files changed, 5 insertions(+) diff --git a/src/Context.cpp b/src/Context.cpp index 6232f4a73..fb4a4c144 100644 --- a/src/Context.cpp +++ b/src/Context.cpp @@ -641,7 +641,10 @@ void Context::staticInitialization () } for (auto& col : columns) + { Task::attributes[col.first] = col.second->type (); + Lexer::attributes[col.first] = col.second->type (); + } Task::urgencyProjectCoefficient = config.getReal ("urgency.project.coefficient"); Task::urgencyActiveCoefficient = config.getReal ("urgency.active.coefficient"); diff --git a/src/Lexer.cpp b/src/Lexer.cpp index a4a14cb74..1463e2909 100644 --- a/src/Lexer.cpp +++ b/src/Lexer.cpp @@ -34,6 +34,7 @@ static const std::string uuid_pattern = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; static const unsigned int uuid_min_length = 8; +std::map Lexer::attributes; std::string Lexer::dateFormat = ""; bool Lexer::isoEnabled = true; diff --git a/src/Lexer.h b/src/Lexer.h index 476776755..75c2fe59b 100644 --- a/src/Lexer.h +++ b/src/Lexer.h @@ -41,6 +41,7 @@ public: // These are overridable. static std::string dateFormat; static bool isoEnabled; + static std::map attributes; enum class Type { uuid, number, hex, string,