C++ TargetRTS
Loading...
Searching...
No Matches
RTAsciiDecoding.h
1/*
2 * Licensed Materials - Property of HCL and/or IBM
3 * Copyright HCL Technologies Ltd. 2016, 2021. All Rights Reserved.
4 * Copyright IBM Corporation 1999, 2016. All Rights Reserved.
5 *
6 * U.S. Government Users Restricted Rights - Use, duplication or
7 * disclosure restricted by GSA ADP Schedule.
8 */
9
10#ifndef __RTAsciiDecoding_h__
11#define __RTAsciiDecoding_h__ included
12
13#ifdef PRAGMA
14#pragma interface
15#endif
16
17#ifndef __RTDecoding_h__
18#include <RTDecoding.h>
19#endif
20
21#if OBJECT_DECODE
22
23class RTDataObject;
24class RTIBuffer;
25struct RTUnknownObject;
26
32{
33public:
34 explicit RTAsciiDecoding( RTIBuffer * );
35 virtual ~RTAsciiDecoding( void );
36
37 // All the get/put functions return an int which is non-zero
38 // if the operation was successful. Otherwise, the following
39 // function may be called to discover the reason for the
40 // failure.
41 int getError( void );
42
43 virtual int get( void **, const RTObject_class ** ) override;
44
45 // basic data types
46 virtual int get_address ( void * & ) override;
47 virtual int get_bool ( bool & ) override;
48 virtual int get_char ( char & ) override;
49 virtual int get_wchar_t ( wchar_t & ) override;
50#if RTUseFloatingPoint
51 virtual int get_double ( double & ) override;
52 virtual int get_float ( float & ) override;
53 virtual int get_longdouble( long double & ) override;
54#endif
55 virtual int get_int ( int & ) override;
56 virtual int get_long ( long & ) override;
57
58 virtual int get_unsignedint( unsigned int & ) override;
59 virtual int get_unsignedlong( unsigned long & ) override;
60 virtual int get_unsignedlonglong( unsigned long long & ) override;
61 virtual int get_unsignedshort( unsigned short & ) override;
62 virtual int get_unsignedchar( unsigned char & ) override;
63 virtual int get_long_long( long long & )override;
64
65 virtual int get_short ( short & ) override;
66 virtual int get_uchar ( unsigned char & ) override;
67 virtual int get_unsigned( unsigned & ) override;
68 virtual int get_ulong ( unsigned long & ) override;
69 virtual int get_ushort ( unsigned short & ) override;
70
71 // a nul-terminated string
72 virtual int get_string( char * & ) override;
73
74 // zero or more raw bytes
75 virtual int get_opaque( int &, char * & ) override;
76
77 // an enumerated value
78 virtual int get_enum( int &, int, const RTFieldDescriptor * ) override;
79
80 // a homogeneous array of objects
81 virtual int get_array( void *, int, const RTObject_class * ) override;
82
83 // an indirect object
84 virtual int get_indirect( void *, const RTObject_class * ) override;
85
86 // a structure
87 virtual int get_struct( void *, const RTObject_class * ) override;
88
89protected:
90 virtual char getCharQuote();
91 int getArray( void *, int, const RTObject_class * );
92 int getAddress ( void * & );
93 int getName( char * value, int length );
94 RTUnknownObject * getUnknown( const char * );
95
96 int getNonWhite( char & );
97 int getByte( char & );
98 void ungetByte( char );
99
100 int getFieldListStart( void );
101 int getFieldName( char * value, int length );
102 int getFieldSeparator( void );
103 int getFieldListFinish( void );
104
105private:
106 enum { UngetMax = 3 };
107
108 int unget_size;
109 char unget_buffer[ UngetMax ];
110 RTIBuffer * input;
111
112 // unavailable methods
114 RTAsciiDecoding & operator=( const RTAsciiDecoding & );
115}; //lint !e1712
116
117#endif // OBJECT_DECODE
118
119#endif // __RTAsciiDecoding_h__
The default decoding implementation that is used for all default type descriptors.
Definition: RTAsciiDecoding.h:32
Provides a common interface to certain data type implementations (e.g.
Definition: RTDataObject.h:33
Definition: RTDecoding.h:27
Definition: RTIBuffer.h:22
Definition: RTFieldDescriptor.h:40
A type descriptor providing information about a type.
Definition: RTObject_class.h:64
Definition: RTUnknownObject.h:24