Files
UnrealEngineUWP/Engine/Source/Developer/TraceAnalysis/Public/Trace/DataStream.h
bryan sefcik de1956f47b Ran IWYU on Public headers under Engine/Source/Developer/...
Headers are updated to contain any missing #includes needed to compile and #includes are sorted.  Nothing is removed.

#ushell-cherrypick of 21064294 by bryan.sefcik
#jira
#preflight 62d5c2111062f2e63015e598

#ROBOMERGE-OWNER: bryan.sefcik
#ROBOMERGE-AUTHOR: bryan.sefcik
#ROBOMERGE-SOURCE: CL 21155249 via CL 21158121 via CL 21161259
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v972-20964824)

[CL 21182053 by bryan sefcik in ue5-main branch]
2022-07-20 12:03:45 -04:00

62 lines
1.1 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreFwd.h"
#include "HAL/Platform.h"
#include "Templates/UniquePtr.h"
class IFileHandle;
namespace UE {
namespace Trace {
class IInDataStream
{
public:
virtual ~IInDataStream() = default;
virtual int32 Read(void* Data, uint32 Size) = 0;
virtual void Close() {}
};
/*
* An implementation of IInDataStream that reads from a file on disk.
*/
class TRACEANALYSIS_API FFileDataStream : public IInDataStream
{
public:
FFileDataStream();
~FFileDataStream();
/*
* Open the file.
*
* @param Path The path to the file.
*
* @return True if the file was opened successfully.
*/
bool Open(const TCHAR* Path);
/*
* Read from the file.
*
* @param Data The address in memory to write file data to.
* @param Size The size of available memory at Data.
*
* @return The number of bytes read from the file to Data, or zero in the case of a read failure.
*/
virtual int32 Read(void* Data, uint32 Size) override;
/*
* Close the file.
*/
virtual void Close() override;
private:
TUniquePtr<IFileHandle> Handle;
uint64 Remaining;
};
} // namespace Trace
} // namespace UE