diff options
| author | Paul Buetow <paul@buetow.org> | 2013-04-06 13:14:43 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2013-04-06 13:14:43 +0200 |
| commit | d3982ec72b255876db00825605d1d5aae0bc313e (patch) | |
| tree | a653552b7d229f7f27262980da7550d39961a102 /src/tool/dir.cpp | |
| parent | 796609174e5ecb35fab992969e7690186840048a (diff) | |
tagging ychat-0.7.7.1ychat-0.7.7.1
Diffstat (limited to 'src/tool/dir.cpp')
| -rw-r--r-- | src/tool/dir.cpp | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/src/tool/dir.cpp b/src/tool/dir.cpp index 392112a..a23cca2 100644 --- a/src/tool/dir.cpp +++ b/src/tool/dir.cpp @@ -7,60 +7,60 @@ using namespace std; dir::dir() { - b_open = false; + b_open = false; } dir::~dir() { - dir_vec.clear(); - close_dir(); + vec_dir.clear(); + close_dir(); } bool dir::open_dir( char *c_dir ) { - string s_dir( c_dir ); - return open_dir( s_dir ); + string s_dir( c_dir ); + return open_dir( s_dir ); } bool dir::open_dir( string &s_dir ) { - if ( b_open ) - return false; + if ( b_open ) + return false; - dp = opendir( s_dir.c_str() ); + p_d = opendir( s_dir.c_str() ); - if ( dp == NULL ) - return false; // Could not open dir. + if ( p_d == NULL ) + return false; // Could not open dir. - b_open = true; + b_open = true; - return true; // Could open dir with success. + return true; // Could open dir with success. } void dir::close_dir() { - if ( b_open && dp != NULL ) - { - closedir( dp ); - b_open = false; - } + if ( b_open && p_d != NULL ) + { + closedir( p_d ); + b_open = false; + } } void dir::read_dir() { - if ( dp != NULL ) - while( ep = readdir( dp ) ) - dir_vec.push_back( string( ep->d_name ) ); + if ( p_d != NULL ) + while( p_ep = readdir( p_d ) ) + vec_dir.push_back( string( p_ep->d_name ) ); } -vector<string> +vector<string> dir::get_dir_vec() { - return dir_vec; + return vec_dir; } #endif |
