37 #ifndef OBJTOOLS_BLAST_GENE_INFO_READER___FILE_UTILS__HPP
38 #define OBJTOOLS_BLAST_GENE_INFO_READER___FILE_UTILS__HPP
82 template <
int k_nFields>
91 static bool CheckDirExistence(
const string& strDir);
94 static bool CheckExistence(
const string& strFile);
100 static bool OpenTextInputFile(
const string& strFileName,
104 static bool OpenBinaryInputFile(
const string& strFileName,
108 static bool OpenTextOutputFile(
const string& strFileName,
112 static bool OpenBinaryOutputFile(
const string& strFileName,
124 template <
int k_nFields>
129 template <
int k_nFields>
141 int& nCurrentOffset);
159 out.write((
char*)(&record.
n1),
sizeof(
int));
160 out.write((
char*)(&record.
n2),
sizeof(
int));
167 in.read((
char*)(&record.
n1),
sizeof(
int));
168 in.read((
char*)(&record.
n2),
sizeof(
int));
171 template <
int k_nFields>
176 for (
int iField = 0; iField < k_nFields; iField++)
177 out.write((
char*)(&record.
n[iField]),
sizeof(
int));
180 template <
int k_nFields>
185 for (
int iField = 0; iField < k_nFields; iField++)
186 in.read((
char*)(&record.
n[iField]),
sizeof(
int));
static void ReadRecord(CNcbiIfstream &in, STwoIntRecord &record)
Read a pair of integers from the file.
static void WriteRecord(CNcbiOfstream &out, STwoIntRecord &record)
Write a pair of integers to the file.
std::ofstream out("events_result.xml")
main entry point for tests
Gene information class and related interfaces.
TSeqPos GetLength(const CSeq_id &id, CScope *scope)
Get sequence length if scope not null, else return max possible TSeqPos.
int64_t Int8
8-byte (64-bit) signed integer
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
IO_PREFIX::ofstream CNcbiOfstream
Portable alias for ofstream.
IO_PREFIX::ifstream CNcbiIfstream
Portable alias for ifstream.
#define NCBI_XOBJREAD_EXPORT
Defines classes: CDirEntry, CFile, CDir, CSymLink, CMemoryFile, CFileUtil, CFileLock,...
std::istream & in(std::istream &in_, double &x_)
SMultiIntRecord - an n-tuple of integers.
int n[k_nFields]
Array of integer fields of the record.
STwoIntRecord - a pair of integers.
int n1
First integer field of the record.
int n2
Second integer field of the record.