-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathParamInput.h
31 lines (25 loc) · 953 Bytes
/
ParamInput.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
/*******************************************************************
* ParamInput.h
* KPS
*
* Author: Kareem Omar
* kareem.omar@uah.edu
* https://github.com/komrad36
*
* Last updated Feb 27, 2016
* This application is entirely my own work.
*******************************************************************/
//
// Parses a KPS parameters file into a map of parameter names and values.
//
#pragma once
#include <fstream>
#include <iostream>
#include "FileInput.h"
#include "Params.h"
#include "str_util.h"
// parses 'filename' into 'params', a map of parameter names and values, ignoring lines that begin with
// 'comment_char' and empty lines and using 'delim_char' to separate param names and values
// DEFAULT PARAMETER: delim_char = '='
// DEFAULT PARAMETER: comment_char = '#'
bool parseParams(key_val_map& params, const std::string& filename, const char delim_char = '=', const char comment_char = '#');