MCPcopy Create free account
hub / github.com/XorTroll/Goldleaf / LoadFile

Method LoadFile

Goldleaf/source/ui/ui_FileContentLayout.cpp:144–162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

142 }
143
144 void FileContentLayout::LoadFile(const std::string &path, const std::string &pres_path, fs::Explorer *exp, const bool read_hex) {
145 this->path = path;
146 this->read_hex = read_hex;
147 this->file_exp = exp;
148 this->line_offset = 0;
149 this->x_offset = 0;
150 this->cur_read_lines_max_length = 0;
151
152 if(read_hex) {
153 g_MainApplication->LoadCommonIconMenuData(true, cfg::Strings.GetString(507), CommonIconKind::BinaryFile, cfg::Strings.GetString(468) + ": " + pres_path);
154 }
155 else {
156 g_MainApplication->LoadCommonIconMenuData(true, cfg::Strings.GetString(508), CommonIconKind::TextFile, cfg::Strings.GetString(467) + ": " + pres_path);
157 }
158
159 this->read_lines = this->ReadLines(this->line_offset, this->available_line_count);
160 this->UpdateLineLimits();
161 this->UpdateLines();
162 }
163
164}

Callers 2

OnFileSelectedMethod · 0.80
view_logs_DefaultKeyMethod · 0.80

Calls 4

ReadLinesMethod · 0.95
UpdateLineLimitsMethod · 0.95
UpdateLinesMethod · 0.95

Tested by

no test coverage detected