7 #ifndef PXR_BASE_TF_SAFE_OUTPUT_FILE_H
8 #define PXR_BASE_TF_SAFE_OUTPUT_FILE_H
41 , _targetFileName(std::move(other._targetFileName))
42 , _tempFileName(std::move(other._tempFileName))
43 { other._file =
nullptr; }
47 _targetFileName = std::move(other._targetFileName);
48 _tempFileName = std::move(other._tempFileName);
49 other._file =
nullptr;
74 FILE *
Get()
const {
return _file; }
86 FILE *_file =
nullptr;
87 std::string _targetFileName;
88 std::string _tempFileName;
93 #endif // PXR_BASE_TF_SAFE_OUTPUT_FILE_H
static TF_API TfSafeOutputFile Replace(std::string const &fileName)
TF_API bool IsOpenForUpdate() const
FILE * Get() const
Return the opened FILE *.
TF_API FILE * ReleaseUpdatedFile()
TfSafeOutputFile & operator=(TfSafeOutputFile &&other)
static TF_API TfSafeOutputFile Update(std::string const &fileName)
Open fileName for update ("r+").
TF_API ~TfSafeOutputFile()
Destructor invokes Close().
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
#define PXR_NAMESPACE_CLOSE_SCOPE
TfSafeOutputFile()=default
TfSafeOutputFile(TfSafeOutputFile &&other)