From 617100346633969e896fb52feb7fd6e1d4877ec0 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 16 Jul 2016 14:21:13 -0400 Subject: [PATCH] CmdGet: Added rules back --- src/commands/CmdGet.cpp | 3 ++- src/commands/commands.h | 2 +- src/dom.cpp | 1 + src/init.cpp | 2 +- src/timew.h | 2 +- 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/commands/CmdGet.cpp b/src/commands/CmdGet.cpp index cdae31f8..842258cd 100644 --- a/src/commands/CmdGet.cpp +++ b/src/commands/CmdGet.cpp @@ -35,6 +35,7 @@ // Іdentify DOM references in cli, provide space-separated results. int CmdGet ( const CLI& cli, + Rules& rules, Database& database) { std::vector results; @@ -45,7 +46,7 @@ int CmdGet ( { std::string reference = arg.attribute ("raw"); std::string value; - if (! domGet (database, reference, value)) + if (! domGet (database, rules, reference, value)) throw format ("DOM reference '{1}' is not valid.", reference); results.push_back (value); diff --git a/src/commands/commands.h b/src/commands/commands.h index f6153c4a..a061ea3b 100644 --- a/src/commands/commands.h +++ b/src/commands/commands.h @@ -41,7 +41,7 @@ int CmdDiagnostics ( Rules&, Database&, const Extensions&); int CmdExport (const CLI&, Rules&, Database& ); int CmdExtensions ( Rules&, const Extensions&); int CmdGaps (const CLI&, Rules&, Database& ); -int CmdGet (const CLI&, Database& ); +int CmdGet (const CLI&, Rules&, Database& ); int CmdHelpUsage ( ); int CmdHelp (const CLI& ); int CmdImport ( ); diff --git a/src/dom.cpp b/src/dom.cpp index 540e71a0..0dc3d813 100644 --- a/src/dom.cpp +++ b/src/dom.cpp @@ -35,6 +35,7 @@ //////////////////////////////////////////////////////////////////////////////// bool domGet ( Database& database, + const Rules& rules, const std::string& reference, std::string& value) { diff --git a/src/init.cpp b/src/init.cpp index 43a838e4..b095ba2e 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -265,7 +265,7 @@ int dispatchCommand ( else if (command == "export") status = CmdExport (cli, rules, database ); else if (command == "extensions") status = CmdExtensions ( rules, extensions); else if (command == "gaps") status = CmdGaps (cli, rules, database ); - else if (command == "get") status = CmdGet (cli, database ); + else if (command == "get") status = CmdGet (cli, rules, database ); else if (command == "help") status = CmdHelp (cli ); else if (command == "import") status = CmdImport ( ); else if (command == "join") status = CmdJoin (cli, rules, database ); diff --git a/src/timew.h b/src/timew.h index 9e21be2f..fab516da 100644 --- a/src/timew.h +++ b/src/timew.h @@ -91,6 +91,6 @@ std::string escape (const std::string&, int); std::string quoteIfNeeded (const std::string&); // dom.cpp -bool domGet (Database&, const std::string&, std::string&); +bool domGet (Database&, const Rules&, const std::string&, std::string&); #endif