File: FileUtils.hpp

package info (click to toggle)
pbseqlib 0~20161219-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 5,924 kB
  • ctags: 5,123
  • sloc: cpp: 82,727; makefile: 305; python: 239; sh: 8
file content (27 lines) | stat: -rw-r--r-- 729 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#ifndef _BLASR_FILE_UTILS_HPP_
#define _BLASR_FILE_UTILS_HPP_

#include <iostream>
#include <fstream>
#include <string>
#include <sys/fcntl.h>
#include <sys/mman.h>
#include <sys/types.h> // for lseek
#include <unistd.h> // for lseek
#include <stdio.h>

using namespace std;

bool FileExists(string &fileName);

void CriticalOpenRead(string &fileName, ifstream &file, std::ios::openmode mode=std::ios::in);

int OpenRead(string &fileName, ifstream &file, std::ios::openmode mode=std::ios::in);

void CriticalOpenWrite(string &fileName, ofstream &file, std::ios::openmode mode=std::ios::out);

int OpenWrite(string &fileName, ofstream &file, std::ios::openmode mode=std::ios::out);

int CountLinesInFile(string fileName);

#endif