summaryrefslogtreecommitdiff
path: root/include/object/xdr16input.h
blob: 478be481f2a633c3c5bd4bf1c7b1e6b8e9bc27e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*
 * Copyright 2020 Daniel Friesel
 *
 * SPDX-License-Identifier: BSD-2-Clause
 */
#ifndef XDRINPUT_H
#define XDRINPUT_H

#include <stdint.h>

class XDRInput {
	private:
		XDRInput(const XDRInput& copy);
		char *data;
		uint32_t pos;

	public:
		XDRInput(char *d) : pos(0) { data = d; }
		uint16_t get_uint16();
		int16_t get_int16();
		uint32_t get_uint32();
		int32_t get_int32();
		uint64_t get_uint64();
		int64_t get_int64();
		float get_float();
		double get_double();
		uint16_t get_opaque_length();
		char* get_opaque(uint16_t length);
		void get_string(char *target);
};

#endif