Subversion Repositories DIN Is Noise

Rev

Rev 1763 | Rev 1965 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
964 jag 1
/*
2
* help.cc
1857 jag 3
* DIN Is Noise is copyright (c) 2006-2022 Jagannathan Sampath
1713 jag 4
* DIN Is Noise is released under GNU Public License 2.0
1479 jag 5
* For more information, please visit https://dinisnoise.org/
964 jag 6
*/
7
 
8
#include "help.h"
9
#include "console.h"
10
#include <fstream>
11
using namespace std;
12
extern console cons;
13
extern string user_data_dir;
14
help::help (const string& fname) {
15
  string s;
16
  ifstream file ((user_data_dir + fname).c_str(), ios::in);
17
  if (!file) text.push_back (fname); else while (getline(file, s)) text.push_back (s);
18
}
19
void help::operator() () {
20
  cons.rollup (0);
21
  for (int i = 0, j = text.size(); i < j; ++i) cons << console::cyan << text[i] << eol;
22
  cons.last ();
23
}