MCPcopy Create free account
hub / github.com/acl-dev/acl / next_file

Method next_file

lib_acl_cpp/src/stdlib/scan_dir.cpp:116–151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

114}
115
116const char* scan_dir::next_file(bool full /* = false */)
117{
118 if (scan_ == NULL) {
119 return NULL;
120 }
121
122 const char* file = acl_scan_dir_next_file(scan_);
123 if (file == NULL || *file == 0) {
124 return NULL;
125 }
126 if (!full) {
127 return file;
128 }
129
130 const char* path = curr_path();
131 if (path == NULL) {
132 return NULL;
133 }
134
135 if (file_buf_ == NULL) {
136 file_buf_ = NEW string(256);
137 }
138
139
140#ifdef ACL_WINDOWS
141 file_buf_->format("%s%c%s", path, PATH_SEP_C, file);
142#else
143 if (*path == '/' && *(path + 1) == 0) {
144 file_buf_->format("%s%s", path, file);
145 } else {
146 file_buf_->format("%s%c%s", path, PATH_SEP_C, file);
147 }
148#endif
149
150 return file_buf_->c_str();
151}
152
153const char* scan_dir::next_dir(bool full /* = false */)
154{

Callers 8

ls_fileFunction · 0.80
diff_pathFunction · 0.80
check_pathMethod · 0.80
transferMethod · 0.80
scan_pathFunction · 0.80
TransformPathMethod · 0.80
ScanAddMethod · 0.80
ScanDelMethod · 0.80

Calls 4

acl_scan_dir_next_fileFunction · 0.85
stringClass · 0.50
formatMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected