libosmscout
1.1.1
Toggle main menu visibility
Loading...
Searching...
No Matches
libosmscout
include
osmscout
util
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
25
#include <
osmscout/lib/CoreImportExport.h
>
26
27
#include <
osmscout/ObjectRef.h
>
28
29
#include <
osmscout/util/Exception.h
>
30
31
namespace
osmscout
{
32
40
class
OSMSCOUT_API
HTMLWriter
41
{
42
private
:
43
std::ofstream file;
44
std::string filename;
45
46
public
:
47
HTMLWriter
();
48
virtual
~HTMLWriter
();
49
50
void
Open
(
const
std::string& filename);
51
void
Close
();
52
void
CloseFailsafe
();
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
71
void
WriteDocumentStart
();
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);
82
void
WriteHeaderEnd
();
83
84
void
WriteBodyStart
();
85
86
void
WriteText
(
const
std::string& text);
87
88
void
WriteListStart
();
89
void
WriteListEntryStart
();
90
void
WriteListEntryEnd
();
91
void
WriteListEnd
();
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
99
void
WriteBodyEnd
();
100
101
void
WriteDocumentEnd
();
102
};
103
}
104
105
#endif
CoreImportExport.h
OSMSCOUT_API
#define OSMSCOUT_API
Definition
CoreImportExport.h:45
Exception.h
ObjectRef.h
osmscout::HTMLWriter::WriteLink
void WriteLink(const std::string &url, const std::string &title)
osmscout::HTMLWriter::HTMLWriter
HTMLWriter()
osmscout::HTMLWriter::GetFilename
std::string GetFilename() const
Definition
HTMLWriter.h:64
osmscout::HTMLWriter::IsOpen
bool IsOpen() const
Definition
HTMLWriter.h:54
osmscout::HTMLWriter::Open
void Open(const std::string &filename)
osmscout::HTMLWriter::WriteHeaderEnd
void WriteHeaderEnd()
osmscout::HTMLWriter::Sanitize
std::string Sanitize(const std::string &string) const
osmscout::HTMLWriter::CloseFailsafe
void CloseFailsafe()
osmscout::HTMLWriter::WriteDocumentEnd
void WriteDocumentEnd()
osmscout::HTMLWriter::~HTMLWriter
virtual ~HTMLWriter()
osmscout::HTMLWriter::WriteListEntryStart
void WriteListEntryStart()
osmscout::HTMLWriter::Close
void Close()
osmscout::HTMLWriter::HasError
bool HasError() const
Definition
HTMLWriter.h:59
osmscout::HTMLWriter::WriteDocumentStart
void WriteDocumentStart()
osmscout::HTMLWriter::WriteHeader
void WriteHeader(const std::string &title, const std::string &description, const std::string &keywords, const std::string &stylesheetLocation)
osmscout::HTMLWriter::WriteHeaderStart
void WriteHeaderStart(const std::string &title, const std::string &description, const std::string &keywords, const std::string &stylesheetLocation)
osmscout::HTMLWriter::WriteListEntryEnd
void WriteListEntryEnd()
osmscout::HTMLWriter::WriteBodyStart
void WriteBodyStart()
osmscout::HTMLWriter::WriteListEnd
void WriteListEnd()
osmscout::HTMLWriter::WriteBodyEnd
void WriteBodyEnd()
osmscout::HTMLWriter::WriteListStart
void WriteListStart()
osmscout::HTMLWriter::WriteText
void WriteText(const std::string &text)
osmscout::HTMLWriter::WriteMeta
void WriteMeta(const std::string &name, const std::string &content)
osmscout::HTMLWriter::WriteOSMObjectLink
void WriteOSMObjectLink(const ObjectOSMRef &object, const std::string &name)
osmscout
Definition
Area.h:39
Generated by
1.17.0