Developer documentation
Version 3.0.3-105-gd3941f44
entry.h
Go to the documentation of this file.
1/* Copyright (c) 2008-2022 the MRtrix3 contributors.
2 *
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
6 *
7 * Covered Software is provided under this License on an "as is"
8 * basis, without warranty of any kind, either expressed, implied, or
9 * statutory, including, without limitation, warranties that the
10 * Covered Software is free of defects, merchantable, fit for a
11 * particular purpose or non-infringing.
12 * See the Mozilla Public License v. 2.0 for more details.
13 *
14 * For more details, see http://www.mrtrix.org/.
15 */
16
17#ifndef __file_entry_h__
18#define __file_entry_h__
19
20#include <string>
21
22#include "types.h"
23
24namespace MR
25{
26 namespace File
27 {
28
30 public:
31 Entry (const std::string& fname, int64_t offset = 0) :
32 name (fname), start (offset) { }
33
34 Entry (const Entry&) = default;
35 Entry (Entry&&) noexcept = default;
36 Entry& operator=(Entry&& E) noexcept {
37 name = std::move (E.name);
38 start = E.start;
39 return *this;
40 }
41
42 std::string name;
43 int64_t start;
44 };
45
46
47 inline std::ostream& operator<< (std::ostream& stream, const Entry& e)
48 {
49 stream << "File::Entry { \"" << e.name << "\", offset " << e.start << " }";
50 return stream;
51 }
52 }
53}
54
55#endif
56
Definition: entry.h:29
Entry(Entry &&) noexcept=default
Entry(const std::string &fname, int64_t offset=0)
Definition: entry.h:31
std::string name
Definition: entry.h:42
int64_t start
Definition: entry.h:43
Entry(const Entry &)=default
index_type offset
Definition: loop.h:33
constexpr double e
Definition: math.h:39
#define NOMEMALIGN
Definition: memory.h:22
std::ostream & operator<<(std::ostream &stream, const Entry &e)
Definition: entry.h:47
Definition: base.h:24