|
|
|
|
@ -20,8 +20,12 @@ bool juci::filesystem::read(const std::string &path, Glib::RefPtr<Gtk::TextBuffe
|
|
|
|
|
if(input) { |
|
|
|
|
std::vector<char> buffer(buffer_size); |
|
|
|
|
size_t read_length; |
|
|
|
|
std::string buffer_str; |
|
|
|
|
while((read_length=input.read(&buffer[0], buffer_size).gcount())>0) { |
|
|
|
|
auto ustr=Glib::ustring(std::string(&buffer[0], read_length)); |
|
|
|
|
buffer_str+=std::string(&buffer[0], read_length); |
|
|
|
|
if(buffer_str.back()>=0) { |
|
|
|
|
auto ustr=Glib::ustring(buffer_str); |
|
|
|
|
buffer_str=""; |
|
|
|
|
if(ustr.validate()) |
|
|
|
|
text_buffer->insert_at_cursor(ustr); |
|
|
|
|
else { |
|
|
|
|
@ -29,6 +33,7 @@ bool juci::filesystem::read(const std::string &path, Glib::RefPtr<Gtk::TextBuffe
|
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
input.close(); |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|