17 #define GETTEXT_DOMAIN "wesnoth-lib"
54 current_dir_(uniform_path(get_path(start_file))),
55 chosen_file_(start_file), last_selection_(-1),
73 std::vector<std::string> to_show;
82 to_show.push_back(ss.str());
86 to_show.push_back(display_string);
89 for (it = to_show.begin(); it != to_show.end(); ++it) {
96 assert(!(*it).empty());
97 (*it).resize((*it).size() - 1);
143 if (entry_index >= 0) {
146 const int dir_index = entry_index;
200 if (index != std::string::npos) {
201 res_path = file_or_dir.substr(0, index);
215 if (index != std::string::npos) {
216 curr_path = curr_path.substr(0, index);
222 if (curr_path.empty()) {
227 if (curr_path.size() == 2 && curr_path[1] ==
':') curr_path +=
path_delim;
235 res_string = path.substr(0, path.size() - 1);
241 return path.empty() || (path.size() == 1 && path[0] ==
path_delim);
247 if (!to_add.empty()) {
252 else if (to_add.size() > 1 && to_add[1] ==
':') {
253 joined_path = to_add;
257 joined_path = to_add;
261 joined_path +=
"/" + to_add;
bool delete_file(const std::string &filename)
static const std::string dir_picture("misc/folder-icon.png")
std::vector< std::string > empty_string_vector
match_begin(const std::string &begin)
static const std::string path_up("..")
std::vector< std::pair< const std::string *, const stats * > > levels
Stats (and name) for each scenario. The pointers are never nullptr.
GLsizei const char ** path
bool is_directory(const std::string &fname)
Returns true if the given file is a directory.
const std::string & begin_
void get_files_in_dir(const std::string &dir, std::vector< std::string > *files, std::vector< std::string > *dirs=nullptr, file_name_option mode=FILE_NAME_ONLY, file_filter_option filter=NO_FILTER, file_reorder_option reorder=DONT_REORDER, file_tree_checksum *checksum=nullptr)
Populates 'files' with all the files and 'dirs' with all the directories in dir.
bool make_directory(const std::string &dirname)
Declarations for File-IO.
std::string replace(std::string str, const std::string &src, const std::string &dst)
Replace all instances of src in str with dst.
char const COLUMN_SEPARATOR
bool operator()(const std::string &o) const
bool file_exists(const std::string &name)
Returns true if a file or directory with such name already exists.
GLsizei const GLcharARB ** string
int line_width(const std::string &line, int font_size, int style)
Determine the width of a line of text given a certain font size.