lumiera_/src/lib/query-text.cpp
Ichthyostega 8630e888a5 integrate (placeholder) query definition
effectively this joins the two existing lines
of "Query" classes into one systematic representation
Next step would be to move all mutation operations
over to the Query::Builder
2012-12-07 01:49:35 +01:00

74 lines
2.2 KiB
C++

/*
QueryText - syntactical standard representation for queries
Copyright (C) Lumiera.org
2012, Hermann Vosseler <Ichthyostega@web.de>
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., 675 Mass Ave, Cambridge, MA 02139, USA.
* *****************************************************/
//#include "lib/util.hpp"
//#include "lib/symbol.hpp"
//#include "include/logging.h"
#include "lib/query-text.hpp"
//#include <boost/noncopyable.hpp>
#include <boost/functional/hash.hpp>
#include <string>
//#include <map>
//using std::map;
using std::string;
//using util::contains;
//using util::isnil;
namespace lib {
namespace { // internal details
} // internal details
/** Parse, verify and normalise the raw query definition
* @warning right now (2012) we don't normalise at all
* @todo when integrating a real resolution engine, we
* need to parse and verify the given string.
*/
string
QueryText::normalise (string const& rawDefinition)
{
return rawDefinition;
}
/** support using queries in hashtables.
* @warning right now (2012) the dummy implementation of QueryText
* doesn't normalise the query in any way, which makes the
* generated hash value dependent on the actual textual
* form used to build the QueryText. This is not how
* it's intended to work, it should rely on a normalised
* form after parsing the query definition.
*/
HashVal
hash_value (QueryText const& entry)
{
return boost::hash_value (entry.definition_);
}
} // namespace lib