📝 rename flstream => filestream

This commit is contained in:
ValKmjolnir 2024-05-22 00:08:36 +08:00
parent 7590a286c3
commit b6a7b7f46d
5 changed files with 10 additions and 8 deletions

View File

@ -88,7 +88,9 @@ std::ostream& logo(std::ostream& out) {
<< "repo : https://gitee.com/valkmjolnir/Nasal-Interpreter\n" << "repo : https://gitee.com/valkmjolnir/Nasal-Interpreter\n"
<< "wiki : https://wiki.flightgear.org/Nasal_scripting_language\n" << "wiki : https://wiki.flightgear.org/Nasal_scripting_language\n"
<< "\n" << "\n"
<< "presented by fgprc members - http://fgprc.org.cn\n" << "presented by fgprc members\n"
<< " - fgprc : http://fgprc.org\n"
<< " - fgprc.cn : http://fgprc.org.cn\n"
<< "\n" << "\n"
<< "input <nasal -h> to get help .\n\n"; << "input <nasal -h> to get help .\n\n";
return out; return out;

View File

@ -13,7 +13,7 @@ void operand_line_counter::load_file_line_counter(
file_name_list = file_list; file_name_list = file_list;
file_line_counter = {}; file_line_counter = {};
file_contents = {}; file_contents = {};
flstream fs; filestream fs;
for(usize i =0; i<file_list.size(); ++i) { for(usize i =0; i<file_list.size(); ++i) {
fs.load(file_list[i]); fs.load(file_list[i]);
file_contents.push_back(fs.file_content()); file_contents.push_back(fs.file_content());

View File

@ -71,7 +71,7 @@ std::ostream& reset(std::ostream& s) {
return s; return s;
} }
void flstream::load(const std::string& f) { void filestream::load(const std::string& f) {
if (file==f) { // don't need to load a loaded file if (file==f) { // don't need to load a loaded file
return; return;
} }

View File

@ -29,13 +29,13 @@ std::ostream& orange(std::ostream&);
std::ostream& white(std::ostream&); std::ostream& white(std::ostream&);
std::ostream& reset(std::ostream&); std::ostream& reset(std::ostream&);
class flstream { class filestream {
protected: protected:
std::string file; std::string file;
std::vector<std::string> res; std::vector<std::string> res;
public: public:
flstream(): file("") {} filestream(): file("") {}
void load(const std::string&); void load(const std::string&);
const std::string& operator[](usize n) const {return res[n];} const std::string& operator[](usize n) const {return res[n];}
const auto& name() const {return file;} const auto& name() const {return file;}
@ -43,7 +43,7 @@ public:
usize size() const {return res.size();} usize size() const {return res.size();}
}; };
class error: public flstream { class error: public filestream {
private: private:
u32 cnt; // counter for errors u32 cnt; // counter for errors

View File

@ -105,7 +105,7 @@ const char* get_platform() {
} else if (is_macos()) { } else if (is_macos()) {
return "macOS"; return "macOS";
} }
return "unknown platform"; return "unknown";
} }
const char* get_arch() { const char* get_arch() {
@ -126,7 +126,7 @@ const char* get_arch() {
} else if (is_superh()) { } else if (is_superh()) {
return "superh"; return "superh";
} }
return "unknown arch"; return "unknown";
} }
f64 hex_to_f64(const char* str) { f64 hex_to_f64(const char* str) {