sptk2 logo
SPTK Home Page
WSType.h
1/*
2╔══════════════════════════════════════════════════════════════════════════════╗
3║ SIMPLY POWERFUL TOOLKIT (SPTK) ║
4╟──────────────────────────────────────────────────────────────────────────────╢
5║ copyright © 1999-2022 Alexey Parshin. All rights reserved. ║
6║ email alexeyp@gmail.com ║
7╚══════════════════════════════════════════════════════════════════════════════╝
8┌──────────────────────────────────────────────────────────────────────────────┐
9│ This library is free software; you can redistribute it and/or modify it │
10│ under the terms of the GNU Library General Public License as published by │
11│ the Free Software Foundation; either version 2 of the License, or (at your │
12│ option) any later version. │
13│ │
14│ This library is distributed in the hope that it will be useful, but │
15│ WITHOUT ANY WARRANTY; without even the implied warranty of │
16│ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library │
17│ General Public License for more details. │
18│ │
19│ You should have received a copy of the GNU Library General Public License │
20│ along with this library; if not, write to the Free Software Foundation, │
21│ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. │
22│ │
23│ Please report all bugs and problems to alexeyp@gmail.com. │
24└──────────────────────────────────────────────────────────────────────────────┘
25*/
26
27#pragma once
28
29#include <sptk5/xdoc/Node.h>
30
31namespace sptk {
32
41class SP_EXPORT WSType
42{
43public:
47 WSType() = default;
48
53 explicit WSType(const char* name)
54 : m_name(name)
55 {
56 }
57
58 WSType(const WSType&) = default;
59
60 WSType(WSType&&) noexcept = default;
61
62 WSType& operator=(const WSType&)
63 {
64 return *this;
65 }
66
67 WSType& operator=(WSType&&) noexcept
68 {
69 return *this;
70 }
71
72 virtual ~WSType() = default;
73
78 [[nodiscard]] virtual String className() const
79 {
80 return "";
81 }
82
83 [[nodiscard]] virtual String name() const
84 {
85 return m_name;
86 }
87
88 virtual void owaspCheck(const String& value);
89
93 virtual void clear() = 0;
94
100 virtual void load(const xdoc::SNode& attr, bool nullLargeData = false) = 0;
101
105 virtual String asString() const
106 {
107 return "";
108 }
109
110 virtual bool isNull() const = 0;
111
117 virtual void exportTo(const xdoc::SNode& parent, const char* name = nullptr) const = 0;
118
119private:
120 const String m_name;
121};
122
123} // namespace sptk
Definition: String.h:49
Definition: WSType.h:42
virtual void load(const xdoc::SNode &attr, bool nullLargeData=false)=0
virtual void clear()=0
WSType(const char *name)
Definition: WSType.h:53
virtual String asString() const
Definition: WSType.h:105
virtual String className() const
Definition: WSType.h:78
WSType()=default
virtual void exportTo(const xdoc::SNode &parent, const char *name=nullptr) const =0

Fri Oct 14 2022 09:58:32: SPTK 5.4.1