Classdesc 3.44
xml_common.h
1/*
2 @copyright Russell Standish 2000-2013
3 @author Russell Standish
4 This file is part of Classdesc
5
6 Open source licensed under the MIT license. See LICENSE for details.
7*/
8
9#ifndef CLASSDESC_XML_COMMON_H
10#define CLASSDESC_XML_COMMON_H
11namespace classdesc
12{
14 inline std::string idx(const std::string& prefix, size_t i)
15 {
16 std::ostringstream s;
17 s<<prefix<<"#"<<i;
18 return s.str();
19 }
20
22 struct CDATA: public std::string
23 {
24 using std::string::operator=;
25 CDATA() {}
26 template <class T> CDATA(T x): std::string(x) {}
27 template <class T, class U> CDATA(T x, U y): std::string(x,y) {}
28 };
29
30 class xml_pack_t;
31 class xml_unpack_t;
32}
33
34#ifdef _CLASSDESC
35#pragma omit xml_pack classdesc::CDATA
36#pragma omit xml_unpack classdesc::CDATA
37#endif
38
39namespace classdesc_access
40{
41 template <class T> struct access_xml_pack;
42 template <class T> struct access_xml_unpack;
43}
44
45#endif
Definition xml_pack_base.h:56
Definition xml_unpack_base.h:317
Contains access_* structs, and nothing else. These structs are used to gain access to private members...
Definition classdesc_access.h:20
Contains definitions related to classdesc functionality.
std::string idx(const std::string &prefix, size_t i)
utility for generating index keys (for use with arrays)
Definition xml_common.h:14