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#if RTUseFloatingPoint
50 virtual int get_double ( double & ) override;
51 virtual int get_float ( float & ) override;
52#endif
53 virtual int get_int ( int & ) override;
54 virtual int get_long ( long & ) override;
55
56 virtual int get_unsignedint( unsigned int & ) override;
57 virtual int get_unsignedlong( unsigned long & ) override;
58 virtual int get_unsignedlonglong( unsigned long long & ) override;
59 virtual int get_unsignedshort( unsigned short & ) override;
60 virtual int get_unsignedchar( unsigned char & ) override;
61 virtual int get_long_long( long long & )override;
62
63 virtual int get_short ( short & ) override;
64 virtual int get_uchar ( unsigned char & ) override;
65 virtual int get_unsigned( unsigned & ) override;
66 virtual int get_ulong ( unsigned long & ) override;
67 virtual int get_ushort ( unsigned short & ) override;
68
69 // a nul-terminated string
70 virtual int get_string( char * & ) override;
71
72 // zero or more raw bytes
73 virtual int get_opaque( int &, char * & ) override;
74
75 // an enumerated value
76 virtual int get_enum( int &, int, const RTFieldDescriptor * ) override;
77
78 // a homogeneous array of objects
79 virtual int get_array( void *, int, const RTObject_class * ) override;
80
81 // an indirect object
82 virtual int get_indirect( void *, const RTObject_class * ) override;
83
84 // a structure
85 virtual int get_struct( void *, const RTObject_class * ) override;
86
87protected:
88 virtual char getCharQuote();
89 int getArray( void *, int, const RTObject_class * );
90 int getAddress ( void * & );
91 int getName( char * value, int length );
92 RTUnknownObject * getUnknown( const char * );
93
94 int getNonWhite( char & );
95 int getByte( char & );
96 void ungetByte( char );
97
98 int getFieldListStart( void );
99 int getFieldName( char * value, int length );
100 int getFieldSeparator( void );
101 int getFieldListFinish( void );
102
103private:
104 enum { UngetMax = 3 };
105
106 int unget_size;
107 char unget_buffer[ UngetMax ];
108 RTIBuffer * input;
109
110 // unavailable methods
112 RTAsciiDecoding & operator=( const RTAsciiDecoding & );
113}; //lint !e1712
114
115#endif // OBJECT_DECODE
116
117#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