Audacity  3.0.3
Typedefs | Functions | Variables
anonymous_namespace{ProjectSerializer.cpp} Namespace Reference

Typedefs

using UShort = std::uint16_t
 
using Int = std::int32_t
 
using Long = std::int32_t
 
using ULong = std::uint32_t
 
using LongLong = std::int64_t
 
using Length = Int
 
using Digits = Int
 

Functions

bool IsLittleEndian ()
 
template<typename Number >
void WriteLittleEndian (wxMemoryBuffer &out, Number value)
 
template<typename Number >
void WriteBigEndian (wxMemoryBuffer &out, Number value)
 
template<typename Number >
Number ReadLittleEndian (wxMemoryInputStream &in)
 
template<typename Number >
Number ReadBigEndian (wxMemoryInputStream &in)
 

Variables

static const auto WriteUShort
 
static const auto WriteInt
 
static const auto WriteLong
 
static const auto WriteULong
 
static const auto WriteLongLong
 
static const auto ReadUShort
 
static const auto ReadInt
 
static const auto ReadLong
 
static const auto ReadULong
 
static const auto ReadLongLong
 
static const auto WriteLength = WriteInt
 
static const auto ReadLength = ReadInt
 
static const auto WriteDigits = WriteInt
 
static const auto ReadDigits = ReadInt
 

Typedef Documentation

◆ Digits

using anonymous_namespace{ProjectSerializer.cpp}::Digits = typedef Int

Definition at line 195 of file ProjectSerializer.cpp.

◆ Int

using anonymous_namespace{ProjectSerializer.cpp}::Int = typedef std::int32_t

Definition at line 105 of file ProjectSerializer.cpp.

◆ Length

using anonymous_namespace{ProjectSerializer.cpp}::Length = typedef Int

Definition at line 191 of file ProjectSerializer.cpp.

◆ Long

using anonymous_namespace{ProjectSerializer.cpp}::Long = typedef std::int32_t

Definition at line 107 of file ProjectSerializer.cpp.

◆ LongLong

using anonymous_namespace{ProjectSerializer.cpp}::LongLong = typedef std::int64_t

Definition at line 110 of file ProjectSerializer.cpp.

◆ ULong

using anonymous_namespace{ProjectSerializer.cpp}::ULong = typedef std::uint32_t

Definition at line 108 of file ProjectSerializer.cpp.

◆ UShort

using anonymous_namespace{ProjectSerializer.cpp}::UShort = typedef std::uint16_t

Definition at line 104 of file ProjectSerializer.cpp.

Function Documentation

◆ IsLittleEndian()

bool anonymous_namespace{ProjectSerializer.cpp}::IsLittleEndian ( )

Definition at line 113 of file ProjectSerializer.cpp.

114  {
115  const std::uint32_t x = 1u;
116  return
117  static_cast<const unsigned char*>(static_cast<const void*>(&x))[0];
118  // We will assume the same for other widths!
119  }

◆ ReadBigEndian()

template<typename Number >
Number anonymous_namespace{ProjectSerializer.cpp}::ReadBigEndian ( wxMemoryInputStream &  in)

Definition at line 156 of file ProjectSerializer.cpp.

157  {
158  Number result;
159  in.Read( &result, sizeof(result) );
160  auto begin = static_cast<unsigned char*>( static_cast<void*>( &result ) );
161  std::reverse( begin, begin + sizeof( result ) );
162  return result;
163  }

◆ ReadLittleEndian()

template<typename Number >
Number anonymous_namespace{ProjectSerializer.cpp}::ReadLittleEndian ( wxMemoryInputStream &  in)

Definition at line 147 of file ProjectSerializer.cpp.

148  {
149  Number result;
150  in.Read( &result, sizeof(result) );
151  return result;
152  }

◆ WriteBigEndian()

template<typename Number >
void anonymous_namespace{ProjectSerializer.cpp}::WriteBigEndian ( wxMemoryBuffer &  out,
Number  value 
)

Definition at line 138 of file ProjectSerializer.cpp.

139  {
140  auto begin = static_cast<unsigned char*>( static_cast<void*>( &value ) );
141  std::reverse( begin, begin + sizeof( value ) );
142  out.AppendData( &value, sizeof(value) );
143  }

◆ WriteLittleEndian()

template<typename Number >
void anonymous_namespace{ProjectSerializer.cpp}::WriteLittleEndian ( wxMemoryBuffer &  out,
Number  value 
)

Definition at line 131 of file ProjectSerializer.cpp.

132  {
133  out.AppendData( &value, sizeof(value) );
134  }

Variable Documentation

◆ ReadDigits

const auto anonymous_namespace{ProjectSerializer.cpp}::ReadDigits = ReadInt
static

Definition at line 197 of file ProjectSerializer.cpp.

Referenced by ProjectSerializer::Decode().

◆ ReadInt

const auto anonymous_namespace{ProjectSerializer.cpp}::ReadInt
static
Initial value:
? &ReadLittleEndian<Int> : &ReadBigEndian<Int>

Definition at line 179 of file ProjectSerializer.cpp.

Referenced by ProjectSerializer::Decode(), and EnumSetting< DitherType >::ReadEnum().

◆ ReadLength

const auto anonymous_namespace{ProjectSerializer.cpp}::ReadLength = ReadInt
static

Definition at line 193 of file ProjectSerializer.cpp.

Referenced by ProjectSerializer::Decode().

◆ ReadLong

const auto anonymous_namespace{ProjectSerializer.cpp}::ReadLong
static
Initial value:
? &ReadLittleEndian<Long> : &ReadBigEndian<Long>

Definition at line 181 of file ProjectSerializer.cpp.

Referenced by ProjectSerializer::Decode().

◆ ReadLongLong

const auto anonymous_namespace{ProjectSerializer.cpp}::ReadLongLong
static
Initial value:
? &ReadLittleEndian<LongLong> : &ReadBigEndian<LongLong>

Definition at line 185 of file ProjectSerializer.cpp.

Referenced by ProjectSerializer::Decode().

◆ ReadULong

const auto anonymous_namespace{ProjectSerializer.cpp}::ReadULong
static
Initial value:
? &ReadLittleEndian<ULong> : &ReadBigEndian<ULong>

Definition at line 183 of file ProjectSerializer.cpp.

Referenced by ProjectSerializer::Decode().

◆ ReadUShort

const auto anonymous_namespace{ProjectSerializer.cpp}::ReadUShort
static
Initial value:
? &ReadLittleEndian<UShort> : &ReadBigEndian<UShort>

Definition at line 177 of file ProjectSerializer.cpp.

Referenced by ProjectSerializer::Decode().

◆ WriteDigits

const auto anonymous_namespace{ProjectSerializer.cpp}::WriteDigits = WriteInt
static

Definition at line 196 of file ProjectSerializer.cpp.

Referenced by ProjectSerializer::WriteAttr().

◆ WriteInt

const auto anonymous_namespace{ProjectSerializer.cpp}::WriteInt
static
Initial value:
? &WriteLittleEndian<Int> : &WriteBigEndian<Int>

Definition at line 168 of file ProjectSerializer.cpp.

Referenced by ProjectSerializer::WriteAttr(), and EnumSetting< DitherType >::WriteEnum().

◆ WriteLength

const auto anonymous_namespace{ProjectSerializer.cpp}::WriteLength = WriteInt
static

◆ WriteLong

const auto anonymous_namespace{ProjectSerializer.cpp}::WriteLong
static
Initial value:
? &WriteLittleEndian<Long> : &WriteBigEndian<Long>

Definition at line 170 of file ProjectSerializer.cpp.

Referenced by ProjectSerializer::WriteAttr().

◆ WriteLongLong

const auto anonymous_namespace{ProjectSerializer.cpp}::WriteLongLong
static
Initial value:
? &WriteLittleEndian<LongLong> : &WriteBigEndian<LongLong>

Definition at line 174 of file ProjectSerializer.cpp.

Referenced by ProjectSerializer::WriteAttr().

◆ WriteULong

const auto anonymous_namespace{ProjectSerializer.cpp}::WriteULong
static
Initial value:
? &WriteLittleEndian<ULong> : &WriteBigEndian<ULong>

Definition at line 172 of file ProjectSerializer.cpp.

Referenced by ProjectSerializer::WriteAttr().

◆ WriteUShort

const auto anonymous_namespace{ProjectSerializer.cpp}::WriteUShort
static
Initial value:
? &WriteLittleEndian<UShort> : &WriteBigEndian<UShort>

Definition at line 166 of file ProjectSerializer.cpp.

Referenced by ProjectSerializer::WriteName().

anonymous_namespace{ProjectSerializer.cpp}::IsLittleEndian
bool IsLittleEndian()
Definition: ProjectSerializer.cpp:113