file.h
Go to the documentation of this file.
1 //
2 // Bareflank Hypervisor
3 //
4 // Copyright (C) 2015 Assured Information Security, Inc.
5 // Author: Rian Quinn <quinnr@ainfosec.com>
6 // Author: Brendan Kerrigan <kerriganb@ainfosec.com>
7 //
8 // This library is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU Lesser General Public
10 // License as published by the Free Software Foundation; either
11 // version 2.1 of the License, or (at your option) any later version.
12 //
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Lesser General Public License for more details.
17 //
18 // You should have received a copy of the GNU Lesser General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 
22 #ifndef FILE_H
23 #define FILE_H
24 
25 #include <string>
26 #include <vector>
27 
35 class file
36 {
37 public:
38 
40  using binary_data = std::vector<char>;
42 
50  file() noexcept = default;
51 
57  virtual ~file() = default;
58 
69  virtual text_data read_text(const filename_type &filename) const;
70 
81  virtual binary_data read_binary(const filename_type &filename) const;
82 
94  virtual void write_text(const filename_type &filename, const text_data &data) const;
95 
107  virtual void write_binary(const filename_type &filename, const binary_data &data) const;
108 };
109 
110 #endif
Definition: file.h:35
file() noexcept=default
int64_t unsigned long void * data
virtual void write_binary(const filename_type &filename, const binary_data &data) const
Definition: file.cpp:69
void uint64_t uint64_t uint64_t *rdx noexcept
std::string text_data
Definition: file.h:39
virtual text_data read_text(const filename_type &filename) const
Definition: file.cpp:30
std::string filename_type
Definition: file.h:41
virtual void write_text(const filename_type &filename, const text_data &data) const
Definition: file.cpp:54
virtual binary_data read_binary(const filename_type &filename) const
Definition: file.cpp:42
std::vector< char > binary_data
Definition: file.h:40