libosmscout 1.1.1
Loading...
Searching...
No Matches
HTMLWriter.h
Go to the documentation of this file.
1#ifndef OSMSCOUT_HTMLWRITER_H
2#define OSMSCOUT_HTMLWRITER_H
3
4/*
5 This source is part of the libosmscout library
6 Copyright (C) 2016 Tim Teulings
7
8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Lesser General Public
10 License as published by the Free Software Foundation; either
11 version 2.1 of the License, or (at your option) any later version.
12
13 This library is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
17
18 You should have received a copy of the GNU Lesser General Public
19 License along with this library; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21*/
22
23#include <fstream>
24
26
27#include <osmscout/ObjectRef.h>
28
30
31namespace osmscout {
32
41 {
42 private:
43 std::ofstream file;
44 std::string filename;
45
46 public:
48 virtual ~HTMLWriter();
49
50 void Open(const std::string& filename);
51 void Close();
53
54 inline bool IsOpen() const
55 {
56 return file.is_open();
57 }
58
59 inline bool HasError() const
60 {
61 return file.fail();
62 }
63
64 inline std::string GetFilename() const
65 {
66 return filename;
67 }
68
69 std::string Sanitize(const std::string& string) const;
70
72 void WriteHeader(const std::string& title,
73 const std::string& description,
74 const std::string& keywords,
75 const std::string& stylesheetLocation);
76 void WriteHeaderStart(const std::string& title,
77 const std::string& description,
78 const std::string& keywords,
79 const std::string& stylesheetLocation);
80 void WriteMeta(const std::string& name,
81 const std::string& content);
83
85
86 void WriteText(const std::string& text);
87
92
93 void WriteLink(const std::string& url,
94 const std::string& title);
95
96 void WriteOSMObjectLink(const ObjectOSMRef& object,
97 const std::string& name);
98
100
102 };
103}
104
105#endif
#define OSMSCOUT_API
Definition CoreImportExport.h:45
void WriteLink(const std::string &url, const std::string &title)
std::string GetFilename() const
Definition HTMLWriter.h:64
bool IsOpen() const
Definition HTMLWriter.h:54
void Open(const std::string &filename)
std::string Sanitize(const std::string &string) const
bool HasError() const
Definition HTMLWriter.h:59
void WriteHeader(const std::string &title, const std::string &description, const std::string &keywords, const std::string &stylesheetLocation)
void WriteHeaderStart(const std::string &title, const std::string &description, const std::string &keywords, const std::string &stylesheetLocation)
void WriteText(const std::string &text)
void WriteMeta(const std::string &name, const std::string &content)
void WriteOSMObjectLink(const ObjectOSMRef &object, const std::string &name)
Definition Area.h:39