File: SillyString.h

package info (click to toggle)
mummy 1.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,628 kB
  • ctags: 1,000
  • sloc: cpp: 10,667; cs: 1,107; makefile: 22; xml: 8; sh: 5
file content (53 lines) | stat: -rw-r--r-- 1,731 bytes parent folder | download | duplicates (2)
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
#ifndef _SillyString_h
#define _SillyString_h

#if 0

#include "VehiclesConfig.h"
#include <string>

// http://en.wikipedia.org/wiki/Silly_string
//
// SillyString is a "yet to be documented" example class...
// This class is used to test/demonstrate the "map to native
// C# string" feature of mummy... (via the two iwh* hints
// used here):

// Disable selected MSVC compiler warning messages
#if defined(_MSC_VER)
#if defined(BUILD_SHARED_LIBS)
#pragma warning(disable:4251) /* class needs to have dll-interface to be used by clients */
//#pragma message(" info: disabled warning 4251...")
#pragma warning(disable:4275) /* non dll-interface class ... used as base for dll-interface class */
#endif
#endif

class iwhMapToType(string) iwhStringMethod(c_str) base_dll SillyString : public std::string
{
public:
  // The original string type
  typedef std::string stl_string;

public:
  // String member types
  typedef stl_string::value_type             value_type;
  typedef stl_string::pointer                pointer;
  typedef stl_string::reference              reference;
  typedef stl_string::const_reference        const_reference;
  typedef stl_string::size_type              size_type;
  typedef stl_string::difference_type        difference_type;
  typedef stl_string::iterator               iterator;
  typedef stl_string::const_iterator         const_iterator;
  typedef stl_string::reverse_iterator       reverse_iterator;
  typedef stl_string::const_reverse_iterator const_reverse_iterator;

  // SillyString constructors
  SillyString();
  SillyString(const value_type* s);
  SillyString(const value_type* s, size_type n);
  SillyString(const stl_string& s, size_type pos = 0, size_type n = npos);
};

#endif

#endif