1 /******************************************************************************
2 * Copyright (c) 2000-2016 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
13 * Szabo, Janos Zoltan – initial implementation
15 ******************************************************************************/
24 int buf_size; ///< amount of allocated memory
25 int buf_begin; ///< number of reserved bytes
26 int buf_pos; ///< read position into the payload
27 int buf_len; ///< number of payload bytes
30 void Allocate(int size);
31 void Reallocate(int size);
33 boolean safe_pull_int(int_val_t& value);
34 /// Copy constructor disabled
35 Text_Buf(const Text_Buf&);
36 /// Assignment disabled
37 Text_Buf& operator=(const Text_Buf&);
43 inline void rewind() { buf_pos = buf_begin; }
45 inline int get_len() const { return buf_len; }
46 inline int get_pos() const { return buf_pos - buf_begin; }
47 inline void buf_seek(int new_pos) { buf_pos = buf_begin + new_pos; }
48 inline const char *get_data() const
49 { return (const char*)data_ptr + buf_begin; }
51 void push_int(const int_val_t& value);
52 void push_int(const RInt& value);
53 const int_val_t pull_int();
55 void push_double(double value);
58 void push_raw(int len, const void *data);
59 void push_raw_front(int len, const void *data);
60 void pull_raw(int len, void *data);
62 void push_string(const char *string_ptr);
65 void push_qualified_name(const qualified_name& name);
66 void pull_qualified_name(qualified_name& name);
68 void calculate_length();
70 void get_end(char*& end_ptr, int& end_len);
71 void increase_length(int add_len);