MCPcopy Create free account
hub / github.com/davisking/dlib / set_dir

Method set_dir

dlib/gui_widgets/widgets.cpp:3169–3211  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3167 // ------------------------------------------------------------------------------------
3168
3169 bool box_win::
3170 set_dir (
3171 const std::string& dir
3172 )
3173 {
3174 try
3175 {
3176 directory d(dir);
3177 queue<directory>::kernel_1a_c qod;
3178 queue<file>::kernel_1a_c qof;
3179 queue<std::string>::sort_1a_c qos;
3180 d.get_dirs(qod);
3181 d.get_files(qof);
3182
3183 qod.reset();
3184 while (qod.move_next())
3185 {
3186 std::string temp = qod.element().name();
3187 qos.enqueue(temp);
3188 }
3189 qos.sort(case_insensitive_compare());
3190 lb_dirs.load(qos);
3191 qos.clear();
3192
3193 qof.reset();
3194 while (qof.move_next())
3195 {
3196 std::string temp = qof.element().name();
3197 qos.enqueue(temp);
3198 }
3199 qos.sort(case_insensitive_compare());
3200 lb_files.load(qos);
3201 return true;
3202 }
3203 catch (directory::listing_error& )
3204 {
3205 return false;
3206 }
3207 catch (directory::dir_not_found&)
3208 {
3209 return false;
3210 }
3211 }
3212
3213 // ------------------------------------------------------------------------------------
3214

Callers

nothing calls this directly

Calls 10

sortMethod · 0.80
get_dirsMethod · 0.45
get_filesMethod · 0.45
resetMethod · 0.45
move_nextMethod · 0.45
nameMethod · 0.45
enqueueMethod · 0.45
loadMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected