/usr/include/osgEarthSymbology/Tags is in libosgearth-dev 2.7.0+dfsg-2+b3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 | /* -*-c++-*- */
/* osgEarth - Dynamic map generation toolkit for OpenSceneGraph
* Copyright 2015 Pelican Mapping
* http://osgearth.org
*
* osgEarth is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*/
#ifndef OSGEARTHSYMBOLOGY_TAGS_H
#define OSGEARTHSYMBOLOGY_TAGS_H 1
#include <osgEarthSymbology/Common>
#include <osgEarth/StringUtils>
#include <osg/CopyOp>
#include <vector>
#include <set>
#include <algorithm>
namespace osgEarth { namespace Symbology
{
typedef std::vector<std::string> TagVector;
typedef std::set<std::string> TagSet;
template<typename T>
class Taggable : public T
{
public:
Taggable()
{
}
Taggable(const Taggable& rhs,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY):
T(rhs, copyop)
{
_tags = rhs._tags;
}
void addTag( const std::string& tag ) {
_tags.insert( normalize( tag ) );
}
void addTags( const TagVector& tags ) {
for( TagVector::const_iterator i = tags.begin(); i != tags.end(); ++i )
_tags.insert( normalize(*i) );
}
void addTags( const std::string& tagString ) {
TagVector tags;
StringTokenizer( tagString, tags, " ", "\"'", false, true );
addTags( tags );
}
void removeTag( const std::string& tag ) {
_tags.erase( normalize( tag ) );
}
bool containsTag( const std::string& tag ) const {
return _tags.find( normalize( tag )) != _tags.end();
}
bool containsTags( const TagSet& tags) const {
for( TagSet::const_iterator i = tags.begin(); i != tags.end(); i++ ) {
if ( _tags.find( normalize( *i ) ) == _tags.end() )
return false;
}
return true;
}
bool containsTags( const TagVector& tags) const {
for( TagVector::const_iterator i = tags.begin(); i != tags.end(); i++ ) {
if ( _tags.find( normalize( *i ) ) == _tags.end() )
return false;
}
return true;
}
const TagSet& tags() const { return _tags; }
static std::string tagString(const TagSet& tags) {
std::stringstream buf;
for( TagSet::const_iterator i = tags.begin(); i != tags.end(); i++ )
buf << (i != tags.begin()? " " : "") << *i;
std::string result = buf.str();
return result;
}
static std::string tagString(const TagVector& tags) {
std::stringstream buf;
for( TagVector::const_iterator i = tags.begin(); i != tags.end(); i++ )
buf << (i != tags.begin()? " " : "") << *i;
std::string result = buf.str();
return result;
}
std::string tagString() const {
std::stringstream buf;
for( TagSet::const_iterator i = _tags.begin(); i != _tags.end(); i++ )
buf << (i != _tags.begin()? " " : "") << *i;
std::string result = buf.str();
return result;
}
protected:
TagSet _tags;
private:
std::string normalize( const std::string& input ) const {
return osgEarth::toLower(input);
}
};
} } // namespace osgEarth::Symbology
#endif // OSGEARTHSYMBOLOGY_QUERY_H
|