|
|
@ -51,7 +51,7 @@ void Buffer::split_line(string str) |
|
|
|
str_part = str.substr(0, total_pos); |
|
|
|
|
|
|
|
str = str.substr(total_pos + 1, str.length()); |
|
|
|
v.push_back(str_part); |
|
|
|
v_lines_.push_back(str_part); |
|
|
|
} |
|
|
|
//Break out of the loop because there is no way to make the string shorter
|
|
|
|
//I also didn't see why I can't use break and would have to use a boolean
|
|
|
@ -100,7 +100,7 @@ bool Buffer::open(const string & new_file_name, bool add_to_hist_) |
|
|
|
|
|
|
|
//Separate the link path and link name into separate strings. Assuming no spaces in the link path.
|
|
|
|
auto second_space_loc = link_tag.find_first_of(' ', 0); |
|
|
|
std::string file_name = link_tag.substr(0, second_space_loc - 1); |
|
|
|
std::string file_name = link_tag.substr(0, second_space_loc); |
|
|
|
std::string link_name = link_tag.substr(second_space_loc + 1); |
|
|
|
|
|
|
|
//Adds the link as a pair to a vector of links.
|
|
|
@ -143,7 +143,7 @@ bool Buffer::open(const string & new_file_name, bool add_to_hist_) |
|
|
|
} |
|
|
|
// Push the contents of curr_line as it has the last line in the file.
|
|
|
|
split_line(curr_line); |
|
|
|
|
|
|
|
|
|
|
|
ix_top_line_ = 0; |
|
|
|
file_name_ = new_file_name; |
|
|
|
|
|
|
@ -151,6 +151,7 @@ bool Buffer::open(const string & new_file_name, bool add_to_hist_) |
|
|
|
v_hist_.push_back(file_name_); |
|
|
|
curr_link_itr = v_hist_.end() - 1; |
|
|
|
} |
|
|
|
|
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
@ -175,9 +176,5 @@ bool Buffer::back() |
|
|
|
|
|
|
|
open(*curr_link_itr, false); |
|
|
|
|
|
|
|
// for(string x : v_hist_)
|
|
|
|
// cout << x << ' ';
|
|
|
|
// cin.get();
|
|
|
|
|
|
|
|
return true; |
|
|
|
} |