/usr/include/kml/dom/atom.h is in libkml-dev 1.2.0-1ubuntu6.
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 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 | // Copyright 2008, Google Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
// 3. Neither the name of Google Inc. nor the names of its contributors may be
// used to endorse or promote products derived from this software without
// specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// This file contains the declaration of Atom elements used in KML.
// See: http://atompub.org/rfc4287.html.
#ifndef KML_DOM_ATOM_H__
#define KML_DOM_ATOM_H__
#include "kml/dom/element.h"
namespace kmldom {
// <atom:author>, RFC 4287 4.2.1, and 3.2 (atomPersonConstruct)
class AtomAuthor : public BasicElement<Type_AtomAuthor> {
public:
virtual ~AtomAuthor();
// <atom:name>
const string& get_name() const { return name_; }
bool has_name() const { return has_name_; }
void set_name(const string& value) {
name_ = value;
has_name_ = true;
}
void clear_name() {
name_.clear();
has_name_ = false;
}
// <atom:uri>, RFC 3987
const string& get_uri() const { return uri_; }
bool has_uri() const { return has_uri_; }
void set_uri(const string& value) {
uri_ = value;
has_uri_ = true;
}
void clear_uri() {
uri_.clear();
has_uri_ = false;
}
// <atom:email>, RFC 2822
const string& get_email() const { return email_; }
bool has_email() const { return has_email_; }
void set_email(const string& value) {
email_ = value;
has_email_ = true;
}
void clear_email() {
email_.clear();
has_email_ = false;
}
private:
bool has_name_;
string name_;
bool has_uri_;
string uri_;
bool has_email_;
string email_;
friend class KmlFactory;
AtomAuthor();
friend class KmlHandler;
virtual void AddElement(const ElementPtr& element);
friend class Serializer;
virtual void Serialize(Serializer& serializer) const;
LIBKML_DISALLOW_EVIL_CONSTRUCTORS(AtomAuthor);
};
// Elements common to <atom:feed> and <atom:entry>.
class AtomCommon : public Element {
public:
// <atom:id>
const string& get_id() const { return id_; }
bool has_id() const { return has_id_; }
void set_id(const string& value) {
id_ = value;
has_id_ = true;
}
void clear_id() {
id_.clear();
has_id_ = false;
}
// <atom:title>
const string& get_title() const { return title_; }
bool has_title() const { return has_title_; }
void set_title(const string& value) {
title_ = value;
has_title_ = true;
}
void clear_title() {
title_.clear();
has_title_ = false;
}
// <atom:updated>
const string& get_updated() const { return updated_; }
bool has_updated() const { return has_updated_; }
void set_updated(const string& value) {
updated_ = value;
has_updated_ = true;
}
void clear_updated() {
updated_.clear();
has_updated_ = false;
}
// <atom:category>...
void add_category(const AtomCategoryPtr& entry);
size_t get_category_array_size() const {
return category_array_.size();
}
const AtomCategoryPtr& get_category_array_at(size_t index) const {
return category_array_[index];
}
// <atom:link>...
void add_link(const AtomLinkPtr& entry);
size_t get_link_array_size() const {
return link_array_.size();
}
const AtomLinkPtr& get_link_array_at(size_t index) const {
return link_array_[index];
}
protected:
AtomCommon();
void AddElement(const ElementPtr& element);
virtual void Serialize(Serializer& serializer) const;
private:
friend class KmlFactory;
friend class KmlHandler;
friend class Serializer;
bool has_id_;
string id_;
bool has_title_;
string title_;
bool has_updated_;
string updated_;
std::vector<AtomCategoryPtr> category_array_;
std::vector<AtomLinkPtr> link_array_;
LIBKML_DISALLOW_EVIL_CONSTRUCTORS(AtomCommon);
};
// <atom:category scheme="..." term="..." label=..."/>, RFC 4287 4.2.2
// NOTE: This element is not part of the OGC KML 2.2 standard.
class AtomCategory : public BasicElement<Type_AtomCategory> {
public:
virtual ~AtomCategory();
// term=
const string& get_term() const { return term_; }
bool has_term() const { return has_term_; }
void set_term(const string& value) {
term_ = value;
has_term_ = true;
}
void clear_term() {
term_.clear();
has_term_ = false;
}
// scheme=
const string& get_scheme() const { return scheme_; }
bool has_scheme() const { return has_scheme_; }
void set_scheme(const string& value) {
scheme_ = value;
has_scheme_ = true;
}
void clear_scheme() {
scheme_.clear();
has_scheme_ = false;
}
// label=
const string& get_label() const { return label_; }
bool has_label() const { return has_label_; }
void set_label(const string& value) {
label_ = value;
has_label_ = true;
}
void clear_label() {
label_.clear();
has_label_ = false;
}
private:
friend class KmlFactory;
AtomCategory();
friend class KmlHandler;
virtual void AddElement(const ElementPtr& element);
virtual void ParseAttributes(kmlbase::Attributes* attributes);
friend class Serializer;
virtual void Serialize(Serializer& serializer) const;
virtual void SerializeAttributes(kmlbase::Attributes* attributes) const;
bool has_term_;
string term_;
bool has_scheme_;
string scheme_;
bool has_label_;
string label_;
LIBKML_DISALLOW_EVIL_CONSTRUCTORS(AtomCategory);
};
// <atom:content src="..." type="...">, RFC 4287 4.1.3
// NOTE: This element is not part of the OGC KML 2.2 standard.
class AtomContent : public BasicElement<Type_AtomContent> {
public:
virtual ~AtomContent();
// src=
const string& get_src() const { return src_; }
bool has_src() const { return has_src_; }
void set_src(const string& value) {
src_ = value;
has_src_ = true;
}
void clear_src() {
src_.clear();
has_src_ = false;
}
// type=
const string& get_type() const { return type_; }
bool has_type() const { return has_type_; }
void set_type(const string& value) {
type_ = value;
has_type_ = true;
}
void clear_type() {
type_.clear();
has_type_ = false;
}
private:
friend class KmlFactory;
AtomContent();
friend class KmlHandler;
void ParseAttributes(kmlbase::Attributes* attributes);
void SerializeAttributes(kmlbase::Attributes* attributes) const;
friend class Serializer;
virtual void Serialize(Serializer& serializer) const;
bool has_src_;
string src_;
bool has_type_;
string type_;
LIBKML_DISALLOW_EVIL_CONSTRUCTORS(AtomContent);
};
// <atom:entry>, RFC 4287 4.1.2
// NOTE: This element is not part of the OGC KML 2.2 standard.
class AtomEntry : public AtomCommon {
public:
virtual ~AtomEntry();
virtual KmlDomType Type() const { return Type_AtomEntry; }
virtual bool IsA(KmlDomType type) const {
return type == Type_AtomEntry;
}
// This static method makes the class useable with ElementCast.
static KmlDomType ElementType() {
return static_cast<KmlDomType>(Type_AtomEntry);
}
// <atom:summary>
const string& get_summary() const { return summary_; }
bool has_summary() const { return has_summary_; }
void set_summary(const string& value) {
summary_ = value;
has_summary_ = true;
}
void clear_summary() {
summary_.clear();
has_summary_ = false;
}
// <atom:content>
const AtomContentPtr& get_content() const { return content_; }
bool has_content() const { return content_ != NULL; }
void set_content(const AtomContentPtr& content) {
SetComplexChild(content, &content_);
}
void clear_content() {
set_content(NULL);
}
private:
friend class KmlFactory;
AtomEntry();
friend class KmlHandler;
virtual void AddElement(const ElementPtr& element);
friend class Serializer;
virtual void Serialize(Serializer& serializer) const;
bool has_summary_;
string summary_;
AtomContentPtr content_;
LIBKML_DISALLOW_EVIL_CONSTRUCTORS(AtomEntry);
};
// <atom:feed>, RFC 4287 4.1.1
// NOTE: This element is not part of the OGC KML 2.2 standard.
class AtomFeed : public AtomCommon {
public:
virtual ~AtomFeed();
virtual KmlDomType Type() const { return Type_AtomFeed; }
virtual bool IsA(KmlDomType type) const {
return type == Type_AtomFeed;
}
// This static method makes the class useable with ElementCast.
static KmlDomType ElementType() {
return static_cast<KmlDomType>(Type_AtomFeed);
}
// <atom:entry>...
void add_entry(const AtomEntryPtr& entry);
size_t get_entry_array_size() const {
return entry_array_.size();
}
const AtomEntryPtr& get_entry_array_at(size_t index) const {
return entry_array_[index];
}
private:
friend class KmlFactory;
AtomFeed();
friend class Serializer;
virtual void Serialize(Serializer& serializer) const;
friend class KmlHandler;
virtual void AddElement(const ElementPtr& element);
std::vector<AtomEntryPtr> entry_array_;
LIBKML_DISALLOW_EVIL_CONSTRUCTORS(AtomFeed);
};
// <atom:link>, RFC 4287 4.2.7
class AtomLink : public BasicElement<Type_AtomLink> {
public:
virtual ~AtomLink();
// href=, RFC 4287 4.2.7.1, RFC 3987
const string& get_href() const { return href_; }
bool has_href() const { return has_href_; }
void set_href(const string& value) {
href_ = value;
has_href_ = true;
}
void clear_href() {
href_.clear();
has_href_ = false;
}
// rel=, RFC 4287 4.2.7.2, RFC 3987
const string& get_rel() const { return rel_; }
bool has_rel() const { return has_rel_; }
void set_rel(const string& value) {
rel_ = value;
has_rel_ = true;
}
void clear_rel() {
rel_.clear();
has_rel_ = false;
}
// type=, RFC 4287 4.2.7.3, MIME
const string& get_type() const { return type_; }
bool has_type() const { return has_type_; }
void set_type(const string& value) {
type_ = value;
has_type_ = true;
}
void clear_type() {
type_.clear();
has_type_ = false;
}
// hreflang=, RFC 4287 4.2.7.4, RFC 3066
const string& get_hreflang() const { return hreflang_; }
bool has_hreflang() const { return has_hreflang_; }
void set_hreflang(const string& value) {
hreflang_ = value;
has_hreflang_ = true;
}
void clear_hreflang() {
hreflang_.clear();
has_hreflang_ = false;
}
// title=, RFC 4287 4.2.7.5
const string& get_title() const { return title_; }
bool has_title() const { return has_title_; }
void set_title(const string& value) {
title_ = value;
has_title_ = true;
}
void clear_title() {
title_.clear();
has_title_ = false;
}
// length=, RFC 4287 4.2.7.6
int get_length() const { return length_; }
bool has_length() const { return has_length_; }
void set_length(const int value) {
length_ = value;
has_length_ = true;
}
void clear_length() {
length_ = 0;
has_length_ = false;
}
private:
bool has_href_;
string href_;
bool has_rel_;
string rel_;
bool has_type_;
string type_;
bool has_hreflang_;
string hreflang_;
bool has_title_;
string title_;
bool has_length_;
int length_;
friend class KmlFactory;
AtomLink();
friend class KmlHandler;
virtual void AddElement(const ElementPtr& element);
void ParseAttributes(kmlbase::Attributes* attributes);
void SerializeAttributes(kmlbase::Attributes* attributes) const;
friend class Serializer;
virtual void Serialize(Serializer& serializer) const;
LIBKML_DISALLOW_EVIL_CONSTRUCTORS(AtomLink);
};
} // end namespace kmldom
#endif // KML_DOM_ATOM_H__
|