A3/InputProcessor.h

55 lines
1.1 KiB
C
Raw Normal View History

2024-10-07 02:08:54 -06:00
#ifndef INPUTPROCESSOR_H
#define INPUTPROCESSOR_H
#include <fstream>
#include <string>
#include <vector>
class InputProcessor {
public:
/**
* @brief Constructs a new InputProcessor, initializing internal fields to
* defaults
*
*/
InputProcessor();
/**
* @brief Prompts the user for the file to open, and opens it as an ifstream
*
* @return true The stream was opened successfully
* @return false The stream was unable to be opened successfully
*/
bool openStream();
/**
* @brief Closes the open file stream
*
*/
void closeStream();
/**
* @brief Reads all words from the currently open stream, and stores them
* internally in a vector of all words
*
*/
void read();
/**
* @brief Returns all the words parsed by this InputProcessor
*
* @return std::vector<std::string> The vector containing all words
*/
std::vector<std::string> getAllWords();
2024-10-07 02:08:54 -06:00
private:
/**
* @brief The raw file input stream to read from
*
*/
std::ifstream _fileIn;
/**
* @brief The vector containing all parsed words from the input stream
*
*/
std::vector<std::string> _allWords;
2024-10-07 02:08:54 -06:00
};
#endif // INPUTPROCESSOR_H