-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFileOp.h
More file actions
56 lines (49 loc) · 1.25 KB
/
FileOp.h
File metadata and controls
56 lines (49 loc) · 1.25 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#pragma once
//
// FileOp.hpp
// CasperOffTarget
//
// Created by Brian Mendoza on 6/4/18.
// Copyright © 2018 University of Tennessee. All rights reserved.
//
#ifndef FileOp_h
#define FileOp_h
#include <stdio.h>
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <cassert>
/* Class contains the operators for manipulating both generic files and the .cspr and target query file specific operations,
* which are the two main types of files that are processed in this program. */
class FileOp {
/* General functions for reading a file */
public:
FileOp();
void open(std::string);
std::string getLine(int);
std::vector<std::string> getSepLine(int, char);
bool newLine();
void closeFile();
bool endFile();
/* Functions for manipulating .cspr files */
private:
std::vector<std::string> Msplit(const std::string &text, char sep);
private: // Private machinery for parsing the file
std::ifstream* FileStream;
std::string filename;
};
class WriteFile {
/* General functions for writing to a file */
public:
void openWrite(std::string);
void write(std::string);
void write(long);
void write(double);
void writeLine(std::string);
void close();
private:
std::ofstream outputfile;
};
#endif /* FileOp_hpp */
#pragma once