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