-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDayOneParser.h
39 lines (30 loc) · 1.02 KB
/
DayOneParser.h
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
//
// Created by Aidan Nagorcka-Smith on 27/12/2022.
//
#ifndef DAY_ONE_PARSER_H
#define DAY_ONE_PARSER_H
#include <filesystem>
#include <functional>
#include <vector>
#include <fstream>
#include "Elf.h"
namespace AdventOfCode::DayOne::Parser {
using HandleElfCallbackFunction = std::function<void(Elf &&)>;
const auto kDayOneInputFilePath = "../src/data/input_day_one.txt";
/**
* Parse the complete file.
*
* @param inputFilePath path to read from
* @return all Elf's parsed from the file
*/
auto parseFile(const std::filesystem::path &inputFilePath) -> std::vector<Elf>;
/**
* Parse the file one elf at a time, providing each one to a specified handler.
*
* @param inputFilePath path to read from
* @param handleElfCallback callback to process each parsed Elf
*/
auto parseFile(const std::filesystem::path &inputFilePath,
const HandleElfCallbackFunction &&handleElfCallback) -> void;
} // AdventOfCode::DayOne::Parser
#endif // DAY_ONE_PARSER_H