NCBI C++ ToolKit
|
Search Toolkit Book for CFileManifest
#include <util/file_manifest.hpp>
Public Member Functions | |
CFileManifest (const string &manifest_path) | |
CFileManifest (const CArgValue &manifest_path) | |
Convenience constructor, to read a manifest from a command line argument's value. More... | |
void | Validate () const |
Check the manifest for consistency and open all the referenced files. More... | |
string | GetPath () const |
throws CManifestException More... | |
vector< string > | GetAllFilePaths () const |
Returns all the file paths referenced by the manifest. More... | |
string | GetSingleFilePath () const |
Returns the first file path in the manifest. More... | |
void | WriteManyFilePaths (const vector< string > &file_paths) |
Write a list of files to a manifest. Will overwrite any previous data. More... | |
Protected Member Functions | |
void | x_Init () |
Private Attributes | |
string | m_ManifestPath |
Definition at line 49 of file file_manifest.hpp.
Definition at line 47 of file file_manifest.cpp.
References x_Init().
Convenience constructor, to read a manifest from a command line argument's value.
This avoids the user having to choose amongst AsString(), which is correct, and AsInputFile(), which isn't supported (as there is no constructor taking a stream as input).
Definition at line 53 of file file_manifest.cpp.
References x_Init().
vector< string > CFileManifest::GetAllFilePaths | ( | ) | const |
Returns all the file paths referenced by the manifest.
Definition at line 104 of file file_manifest.cpp.
References CDirEntry::CreateAbsolutePath(), m_ManifestPath, NCBI_THROW, and CDirEntry::NormalizePath().
Referenced by CInputStreamSource::InitManifest(), and CAsnSubCacheCreateApplication::Run().
|
inline |
throws CManifestException
Returns the manifest file path, not the files referenced in the manifest.
Definition at line 69 of file file_manifest.hpp.
References m_ManifestPath.
string CFileManifest::GetSingleFilePath | ( | ) | const |
Returns the first file path in the manifest.
Throws if there are more than one file.
Definition at line 127 of file file_manifest.cpp.
References m_ManifestPath, and NCBI_THROW.
void CFileManifest::Validate | ( | void | ) | const |
Check the manifest for consistency and open all the referenced files.
WARNING: This method throws an exception on failure! Be prepared to catch it! Success is indicated by a return without an exception.
Definition at line 66 of file file_manifest.cpp.
References file, CDirEntry::IsFile(), m_ManifestPath, and NCBI_THROW.
Write a list of files to a manifest. Will overwrite any previous data.
Definition at line 153 of file file_manifest.cpp.
References copy(), m_ManifestPath, and NCBI_THROW.
|
protected |
Definition at line 59 of file file_manifest.cpp.
References m_ManifestPath, and NCBI_THROW.
Referenced by CFileManifest().
|
private |
Definition at line 85 of file file_manifest.hpp.
Referenced by GetAllFilePaths(), GetPath(), GetSingleFilePath(), Validate(), WriteManyFilePaths(), and x_Init().