Open 3D Engine AzCore API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AZ::IO Namespace Reference

PathView implementation. More...

Namespaces

namespace  parser
 

Classes

class  AverageWindow
 
class  BasicPath
 
class  BlockCache
 
struct  BlockCacheConfig
 
class  ByteContainerStream
 
class  Compression
 
struct  CompressionInfo
 
union  CompressionTag
 
class  Compressor
 
class  CompressorData
 
struct  CompressorHeader
 
class  CompressorStream
 
class  CompressorZLib
 
class  CompressorZLibData
 
struct  CompressorZLibHeader
 
struct  CompressorZLibSeekPoint
 
class  CompressorZStd
 
class  CompressorZStdData
 
struct  CompressorZStdHeader
 
struct  CompressorZStdSeekPoint
 
class  DedicatedCache
 
struct  DedicatedCacheConfig
 
struct  DriveInformation
 
class  ExternalFileRequest
 
class  FileDescriptorCapturer
 
class  FileDescriptorRedirector
 
class  FileIOBase
 The base class for file IO stack classes. More...
 
class  FileIOStream
 
class  FileRange
 FileRange represents a subsection within a file. More...
 
class  FileReader
 
class  FileRequest
 
class  FileRequestHandle
 
class  FullFileDecompressor
 
struct  FullFileDecompressorConfig
 
class  GenericStream
 
struct  HardwareInformation
 
class  IStreamer
 
class  IStreamerProfiler
 
class  IStreamerStackConfig
 
class  MemoryStream
 
class  MockFileIOBase
 
class  PathIterator
 
class  PathView
 
class  RapidJSONStreamWriter
 Adds caching around the RapidJsonStreamWriter. More...
 
class  RapidJSONWriteStreamUnbuffered
 Implements the rapidjson::Stream concept. More...
 
class  RapidXMLStreamWriter
 
class  ReadSplitter
 
struct  ReadSplitterConfig
 
class  RequestPath
 
class  Result
 
class  Scheduler
 
class  Statistic
 
class  StdoutStream
 
class  StorageDrive
 
struct  StorageDriveConfig
 
class  StorageDriveWin
 
class  Streamer
 
class  StreamerConfig
 
class  StreamerContext
 
class  StreamStackEntry
 
class  SystemFile
 
class  SystemFileStream
 
class  TimedAverageWindowScope
 
class  WindowsStorageDriveConfig
 
struct  WritableStreamType
 
struct  WritableStreamType< true >
 

Typedefs

using DecompressionFunc = AZStd::function< bool(const CompressionInfo &info, const void *compressed, size_t compressedSize, void *uncompressed, size_t uncompressedBufferSize)>
 
using CompressionBus = AZ::EBus< Compression >
 
using HandleType = AZ::u32
 
using SizeType = AZ::u64
 
using OffsetType = AZ::s64
 
using FileRequestPtr = AZStd::intrusive_ptr< ExternalFileRequest >
 
using StreamerProfiler = AZ::Interface< IStreamerProfiler >
 
using FixedMaxPathString = AZStd::basic_fixed_string< char, MaxPathLength, AZStd::char_traits< char > >
 Path aliases.
 
using Path = BasicPath< AZStd::basic_string< char, AZStd::char_traits< char >, AZStd::allocator > >
 
using FixedMaxPath = BasicPath< FixedMaxPathString >
 
template<size_t WindowSize>
using TimedAverageWindow = AverageWindow< Statistic::TimeValue, Statistic::TimeValue, WindowSize >
 
using NiceFileIOBaseMock = ::testing::NiceMock< MockFileIOBase >
 
using DriveList = AZStd::vector< DriveInformation >
 

Enumerations

enum class  ConflictResolution : uint8_t { PreferFile , PreferArchive , UseArchiveOnly }
 
enum class  SeekType : AZ::u32 { SeekFromStart , SeekFromCurrent , SeekFromEnd }
 
enum class  ResultCode : AZ::u32 { Success = 0 , Error = 1 , Error_HandleInvalid = 2 }
 
enum class  OpenMode : AZ::u32 {
  Invalid = 0 , ModeRead = (1 << 0) , ModeWrite = (1 << 1) , ModeAppend = (1 << 2) ,
  ModeBinary = (1 << 3) , ModeText = (1 << 4) , ModeUpdate = (1 << 5) , ModeCreatePath = (1 << 6)
}
 

Functions

bool NameMatchesFilter (AZStd::string_view name, AZStd::string_view filter)
 
SeekType GetSeekTypeFromFSeekMode (int mode)
 
int GetFSeekModeFromSeekType (SeekType type)
 
bool RetryOpenStream (FileIOStream &stream, int numRetries=10, int delayBetweenRetry=250)
 
bool AnyFlag (OpenMode a)
 
OpenMode GetOpenModeFromStringMode (const char *mode)
 
const char * GetStringModeFromOpenMode (OpenMode mode)
 
void UpdateOpenModeForReading (OpenMode &mode)
 
int TranslateOpenModeToSystemFileMode (const char *path, OpenMode mode)
 
template<typename PathType >
constexpr bool operator== (const PathIterator< PathType > &lhs, const PathIterator< PathType > &rhs)
 
template<typename PathType >
constexpr bool operator!= (const PathIterator< PathType > &lhs, const PathIterator< PathType > &rhs)
 
constexpr void swap (PathView &lhs, PathView &rhs) noexcept
 
constexpr size_t hash_value (const PathView &pathToHash) noexcept
 
constexpr bool operator== (const PathView &lhs, const PathView &rhs) noexcept
 
constexpr bool operator!= (const PathView &lhs, const PathView &rhs) noexcept
 
constexpr bool operator< (const PathView &lhs, const PathView &rhs) noexcept
 
constexpr bool operator<= (const PathView &lhs, const PathView &rhs) noexcept
 
constexpr bool operator> (const PathView &lhs, const PathView &rhs) noexcept
 
constexpr bool operator>= (const PathView &lhs, const PathView &rhs) noexcept
 
template<typename StringType >
constexpr void swap (BasicPath< StringType > &lhs, BasicPath< StringType > &rhs) noexcept
 
template<typename StringType >
constexpr size_t hash_value (const BasicPath< StringType > &pathToHash)
 
template<typename StringType >
constexpr BasicPath< StringType > operator/ (const BasicPath< StringType > &lhs, const PathView &rhs)
 
template<typename StringType >
constexpr BasicPath< StringType > operator/ (const BasicPath< StringType > &lhs, AZStd::string_view rhs)
 
template<typename StringType >
constexpr BasicPath< StringType > operator/ (const BasicPath< StringType > &lhs, const typename BasicPath< StringType >::value_type *rhs)
 
template void swap< AZStd::string > (Path &lhs, Path &rhs) noexcept
 
template void swap< FixedMaxPathString > (FixedMaxPath &lhs, FixedMaxPath &rhs) noexcept
 
template size_t hash_value< AZStd::string > (const Path &pathToHash)
 
template size_t hash_value< FixedMaxPathString > (const FixedMaxPath &pathToHash)
 
template BasicPath< AZStd::stringoperator/<AZStd::string > (const BasicPath< AZStd::string > &lhs, const PathView &rhs)
 
template BasicPath< FixedMaxPathStringoperator/<FixedMaxPathString > (const BasicPath< FixedMaxPathString > &lhs, const PathView &rhs)
 
template BasicPath< AZStd::stringoperator/<AZStd::string > (const BasicPath< AZStd::string > &lhs, AZStd::string_view rhs)
 
template BasicPath< FixedMaxPathStringoperator/<FixedMaxPathString > (const BasicPath< FixedMaxPathString > &lhs, AZStd::string_view rhs)
 
template BasicPath< AZStd::stringoperator/<AZStd::string > (const BasicPath< AZStd::string > &lhs, const typename BasicPath< AZStd::string >::value_type *rhs)
 
template BasicPath< FixedMaxPathStringoperator/<FixedMaxPathString > (const BasicPath< FixedMaxPathString > &lhs, const typename BasicPath< FixedMaxPathString >::value_type *rhs)
 
template bool operator==<const PathView > (const PathIterator< const PathView > &lhs, const PathIterator< const PathView > &rhs)
 
template bool operator==<const Path > (const PathIterator< const Path > &lhs, const PathIterator< const Path > &rhs)
 
template bool operator==<const FixedMaxPath > (const PathIterator< const FixedMaxPath > &lhs, const PathIterator< const FixedMaxPath > &rhs)
 
template bool operator!=<const PathView > (const PathIterator< const PathView > &lhs, const PathIterator< const PathView > &rhs)
 
template bool operator!=<const Path > (const PathIterator< const Path > &lhs, const PathIterator< const Path > &rhs)
 
template bool operator!=<const FixedMaxPath > (const PathIterator< const FixedMaxPath > &lhs, const PathIterator< const FixedMaxPath > &rhs)
 
void PathReflect (AZ::ReflectContext *context)
 
bool operator== (const FileRequestHandle &lhs, const FileRequestPtr &rhs)
 
bool operator== (const FileRequestPtr &lhs, const FileRequestHandle &rhs)
 
bool operator!= (const FileRequestHandle &lhs, const FileRequestPtr &rhs)
 
bool operator!= (const FileRequestPtr &lhs, const FileRequestHandle &rhs)
 
bool CollectIoHardwareInformation (HardwareInformation &info, bool includeAllHardware, bool reportHardware)
 
void ReflectNative (ReflectContext *context)
 

Variables

static const HandleType InvalidHandle = 0
 
constexpr size_t MaxPathLength = 1024
 Path Constants.
 
constexpr char PosixPathSeparator = '/'
 
constexpr char WindowsPathSeparator = '\\'
 
static constexpr size_t s_fileNotFound = std::numeric_limits<size_t>::max()
 Constant used to denote "file not found" in StreamStackEntry processing.
 
static const size_t s_statisticsWindowSize = 128
 

Detailed Description

PathView implementation.

AZ::Path iterator implementation.

AZ::PathView functions which returns FixedMaxPath.

Typedef Documentation

◆ Path

Only the following path types are supported The BasicPath template above is shared only amoung the following instantiations

Enumeration Type Documentation

◆ OpenMode

enum class AZ::IO::OpenMode : AZ::u32
strong
Enumerator
ModeRead 

Open the file in read mode ("r") if ModeRead is specified without ModeWrite, the file is open in file share write mode when on platforms that use WinAPI

ModeWrite 

Open the file in write mode ("w") If the ModeAppend option is not specified, the file is truncated

ModeAppend 

Opens the file in append mode ("a") The file is opened and sets the write offset to the end of the file

ModeBinary 

Opens the file with the binary option("b") set.

ModeText 

Opens the file with the text option("t") set This affects may affect how newlines are handled on different platforms ("\n" vs "\r\n")

ModeUpdate 

Open the file in update mode with the ("+") symbol If ModeRead is also set and the file doe NOT exist, it will not be created in that scenario

ModeCreatePath 

Create any parent directory segments that are part of the file path if they don't exist.

Function Documentation

◆ CollectIoHardwareInformation()

bool AZ::IO::CollectIoHardwareInformation ( HardwareInformation info,
bool  includeAllHardware,
bool  reportHardware 
)

Collects hardware information for all hardware that can be used for file IO.

Parameters
infoThe retrieved hardware information.
includeAllHardwareIncludes all available hardware that can be used by AZ::IO::Streamer. If set to false only hardware is listed that is known to be used. This may be more performant, but can result is file requests failing if they use an previously unknown path.
reportHardwareIf true, hardware information will be printed to the log if available.

◆ hash_value() [1/2]

template<typename StringType >
constexpr size_t AZ::IO::hash_value ( const BasicPath< StringType > &  pathToHash)
constexpr

Hashes a value in a manner that if two paths are equal, then their hash values are also equal For example : path "a//b" equals "a/b", the hash value of "a//b" would also equal the hash value of "a/b"

◆ hash_value() [2/2]

constexpr size_t AZ::IO::hash_value ( const PathView pathToHash)
constexprnoexcept

Hashes a value in a manner that if two paths are equal, then their hash values are also equal For example : path "a//b" equals "a/b", the hash value of "a//b" would also equal the hash value of "a/b"

◆ NameMatchesFilter()

bool AZ::IO::NameMatchesFilter ( AZStd::string_view  name,
AZStd::string_view  filter 
)

return true if name of file matches glob filter. glob filters are MS-DOS (or windows) findNextFile style filters like "*.bat" or "blah??.pak" or "test*.exe" and such.

◆ RetryOpenStream()

bool AZ::IO::RetryOpenStream ( FileIOStream stream,
int  numRetries = 10,
int  delayBetweenRetry = 250 
)

ReOpen a stream until it opens - this can help avoid transient problems where the OS has a brief lock on a file stream. returns false if the stream is not open at the end of the retries.

Variable Documentation

◆ s_statisticsWindowSize

const size_t AZ::IO::s_statisticsWindowSize = 128
static

The number of entries in the statistics window. Larger number will measure over a longer time and will be more accurate, but also less responsive to sudden changes.