|
/************************************************************************
Xport: XHTML Parsing & Objective Reporting Toolkit
Copyright (C) 2007 Mitchel Haas
This file is part of Xport.
Xport 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 3 of the License, or
(at your option) any later version.
Xport 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 Xport. If not, see <http://www.gnu.org/licenses/>.
For complete documentation on this library and alternative
licensing options, visit http://www.xportpro.com
Email questions, comments or suggestions to mitchel.haas@xportpro.com
************************************************************************/
#pragma once
#include <vector>
#include <set>
#include <map>
#include "common.h"
#include "tag_trait.h"
namespace Xport
{
template <typename T, typename U> class tag_trait;
template <typename T, typename U> class tag;
template <typename T, typename U> class tag_traits;
template<typename T> struct tag_info;
}
template <typename DT, typename CT>
class Xport::tag_traits
{
public:
// constructors/destructor
tag_traits();
~tag_traits();
// interface
const tag_trait<DT, CT>* get_tag_trait(xhtml_tag_enum _tag) const
{
if (_tag < static_cast<short>(tag_trait_vec.size())) {
return tag_trait_vec[_tag];
}
return NULL;
}
private:
// don't allow copying or assignment
tag_traits& operator =(const tag_traits& rhs);
tag_traits(const tag_traits& _src);
private:
// data
std::vector<tag_trait<DT, CT>*> tag_trait_vec;
// friends
friend class tag<DT, CT>;
};
#include "tag_traits.inl"
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.