adtf_file_library  0.13.2
indexedfile_types.h
Go to the documentation of this file.
1 
17 #pragma once
18 
19 #include <utils5extension/file.h>
20 
29 namespace ifhd
30 {
31 
33 static constexpr size_t max_indexed_streams = 512;
34 
36 static constexpr size_t max_file_extension_identifier_length = 384;
37 
39 static constexpr size_t max_streamname_length = 228;
40 
42 static constexpr auto idx_ext_index = "index";
43 
45 static constexpr auto idx_ext_index_0 = "index0";
46 
48 static constexpr auto idx_ext_index_additional = "index_add";
49 
51 static constexpr auto idx_ext_index_additional_0 = "index_add0";
52 
55 
59 enum class Endianess : uint8_t
60 {
72  platform_big_endian = 0x02
73 };
74 
79 #define PLATFORM_BYTEORDER_UINT8 static_cast<uint8_t>(ifhd::getCurrentPlatformByteorder())
80 
87 static inline Endianess getCurrentPlatformByteorder()
88 {
89  uint32_t value = 0x01020304;
90  if (((unsigned char*)&value)[0] == 0x04 &&
91  ((unsigned char*)&value)[2] == 0x02)
92  {
94  }
95  else if (((unsigned char*)&value)[0] == 0x01 &&
96  ((unsigned char*)&value)[2] == 0x03)
97  {
99  }
100  else
101  {
103  }
104 }
105 
109 namespace exceptions
110 {
125 }
126 
131 #ifndef IFHD_ASSERT
132 #ifdef WIN32
133 #ifdef _ASSERTE
134 #define IFHD_ASSERT _ASSERTE
135 #else
136 #define IFHD_ASSERT assert
137 #endif
138 #else
139 #define IFHD_ASSERT assert
140 #endif
141 #endif
142 
143 } // namespace
Exception to indicate the end of file was reached.
Definition: file.h:61
Indicates a file access error. platform dependent errors can be obtained via code().
Definition: file.h:82
Indicates a file access error while creating a file that already exists and File::om_no_overwrite was...
Definition: file.h:102
utils5ext::exceptions::ErrorFileAccess ErrorFileAccess
Indicates a file access error. platform dependent errors can be obtained via code().
Definition: indexedfile_types.h:119
utils5ext::exceptions::EndOfFile EndOfFile
Exception to indicate the end of file was reached.
Definition: indexedfile_types.h:114
utils5ext::exceptions::ErrorFileAlreadyExists ErrorFileAlreadyExists
Indicates a file access error while creating a file that already exists and tOpenMode::om_no_overwrit...
Definition: indexedfile_types.h:124
namespace for IFHD File library
Definition: indexedfile_types.h:30
Endianess
Definition: indexedfile_types.h:60
@ platform_big_endian
platform has big endianess byte order
@ platform_not_supported
unknown platform or unsupported platform
@ platform_little_endian
platform has little endianess byte order
utils5ext::FilePos FilePos
file pos type
Definition: indexedfile_types.h:54
int64_t FilePos
Type for a file position.
Definition: file.h:37

Copyright © CARIAD SE.
Generated on Mon Jun 10 2024 by doxygen 1.9.1
GIT Commit Hash: eb3af397a6b49ad6fcad9a60d8277d909b458b48