forked from Hongweihuo-Lab/FM-Adaptive
-
Notifications
You must be signed in to change notification settings - Fork 0
/
savekit.h
47 lines (43 loc) · 1.21 KB
/
savekit.h
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*============================================
# Filename: savekit.h
# Ver 1.0 2014-06-08
# Copyright (C) 2014 ChenLonggang ([email protected])
#
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 or later of the License.
#
# Description: A simple tookit for saveing/writing data to file
=============================================*/
#ifndef _SAVEKIT
#define _SAVEKIT
#include<stdio.h>
#include<stdlib.h>
#include"BaseClass.h"
#include<fstream>
#include<iostream>
using namespace std;
class savekit
{
public:
savekit(const char * file);
~savekit();
i32 writei64(i64 value);
i32 writeu64(u64 value);
i32 writei32(i32 value);
i32 writeu32(u32 value);
i32 writei16(i16 value);
i32 writeu16(u16 value);
i32 writeu8(u8 value);
i32 writei64array(i64 * value,i32 len);
i32 writeu64array(u64 * value,i32 len);
i32 writei32array(i32 * value,i32 len);
i32 writeu32array(u32 * value,i32 len);
i32 writei16array(i16 * value,i32 len);
i32 writeu16array(u16 * value,i32 len);
i32 writeu8array(u8 * value,i32 len);
void close();
private:
FILE *w;
};
#endif