1 ///////////////////////////////////////////////////////////////////////////////
2 // Copyright (c) 2000-2015 Ericsson Telecom AB
3 // All rights reserved. This program and the accompanying materials
4 // are made available under the terms of the Eclipse Public License v1.0
5 // which accompanies this distribution, and is available at
6 // http://www.eclipse.org/legal/epl-v10.html
7 ///////////////////////////////////////////////////////////////////////////////
16 int buf_size; ///< amount of allocated memory
17 int buf_begin; ///< number of reserved bytes
18 int buf_pos; ///< read position into the payload
19 int buf_len; ///< number of payload bytes
22 void Allocate(int size);
23 void Reallocate(int size);
25 boolean safe_pull_int(int_val_t& value);
26 /// Copy constructor disabled
27 Text_Buf(const Text_Buf&);
28 /// Assignment disabled
29 Text_Buf& operator=(const Text_Buf&);
35 inline void rewind() { buf_pos = buf_begin; }
37 inline int get_len() const { return buf_len; }
38 inline int get_pos() const { return buf_pos - buf_begin; }
39 inline void buf_seek(int new_pos) { buf_pos = buf_begin + new_pos; }
40 inline const char *get_data() const
41 { return (const char*)data_ptr + buf_begin; }
43 void push_int(const int_val_t& value);
44 void push_int(const RInt& value);
45 const int_val_t pull_int();
47 void push_double(double value);
50 void push_raw(int len, const void *data);
51 void pull_raw(int len, void *data);
53 void push_string(const char *string_ptr);
56 void push_qualified_name(const qualified_name& name);
57 void pull_qualified_name(qualified_name& name);
59 void calculate_length();
61 void get_end(char*& end_ptr, int& end_len);
62 void increase_length(int add_len);