2
2
* File: serialis.h (Formerly serialmac.h)
3
3
* Description: Inline routines and macros for serialisation functions
4
4
* Author: Phil Cheatle
5
- * Created: Tue Oct 08 08:33:12 BST 1991
6
5
*
7
6
* (C) Copyright 1990, Hewlett-Packard Ltd.
8
7
** Licensed under the Apache License, Version 2.0 (the "License");
20
19
#ifndef SERIALIS_H
21
20
#define SERIALIS_H
22
21
22
+ #include < cstdint> // uint8_t
23
+ #include < cstdio>
23
24
#include < cstdlib>
24
25
#include < cstring>
25
- #include < cstdio>
26
- #include " host.h"
27
26
28
- template <typename T> class GenericVector ;
27
+ template <typename T>
28
+ class GenericVector ;
29
29
class STRING ;
30
30
31
31
/* **********************************************************************
@@ -46,11 +46,10 @@ constexpr size_t countof(T const (&)[N]) noexcept {
46
46
47
47
// Function to read a GenericVector<char> from a whole file.
48
48
// Returns false on failure.
49
- typedef bool (*FileReader )(const STRING& filename , GenericVector<char >* data );
49
+ using FileReader = bool (*)(const STRING&, GenericVector<char >*);
50
50
// Function to write a GenericVector<char> to a whole file.
51
51
// Returns false on failure.
52
- typedef bool (*FileWriter)(const GenericVector<char >& data,
53
- const STRING& filename);
52
+ using FileWriter = bool (*)(const GenericVector<char >&, const STRING&);
54
53
55
54
// Deserialize data from file.
56
55
bool DeSerialize (FILE* fp, char * data, size_t n = 1 );
@@ -88,7 +87,9 @@ class TFile {
88
87
// From an open file and an end offset.
89
88
bool Open (FILE* fp, int64_t end_offset);
90
89
// Sets the value of the swap flag, so that FReadEndian does the right thing.
91
- void set_swap (bool value) { swap_ = value; }
90
+ void set_swap (bool value) {
91
+ swap_ = value;
92
+ }
92
93
93
94
// Deserialize data.
94
95
bool DeSerialize (char * data, size_t count = 1 );
0 commit comments