mirror of
https://github.com/lakinduakash/linux-wifi-hotspot.git
synced 2024-11-24 21:20:12 +00:00
rename functions in read_config
This commit is contained in:
parent
30d077deb7
commit
24862a9798
@ -2,19 +2,21 @@
|
||||
// Created by lakinduakash on 14/04/19.
|
||||
//
|
||||
|
||||
#include "read_config.h"
|
||||
|
||||
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <algorithm>
|
||||
|
||||
#include "read_config.h"
|
||||
#include "h_prop.h"
|
||||
|
||||
extern "C" {
|
||||
|
||||
|
||||
int read_config_1() {
|
||||
int read_config_file() {
|
||||
// std::ifstream is RAII, i.e. no need to call close
|
||||
std::ifstream cFile("/home/lakinduakash/wh.config");
|
||||
std::ifstream cFile(CONFIG_FILE);
|
||||
if (cFile.is_open()) {
|
||||
std::string line;
|
||||
while (getline(cFile, line)) {
|
||||
@ -22,7 +24,7 @@ int read_config_1() {
|
||||
line.end());
|
||||
if (line[0] == '#' || line.empty())
|
||||
continue;
|
||||
auto delimiterPos = line.find("=");
|
||||
auto delimiterPos = line.find('=');
|
||||
auto name = line.substr(0, delimiterPos);
|
||||
auto value = line.substr(delimiterPos + 1);
|
||||
std::cout << name << " " << value << '\n';
|
||||
|
@ -9,7 +9,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int read_config_1();
|
||||
int read_config_file();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user