File tree Expand file tree Collapse file tree 3 files changed +46
-38
lines changed Expand file tree Collapse file tree 3 files changed +46
-38
lines changed Original file line number Diff line number Diff line change 1
1
#include " ProfileLoader.hpp"
2
2
3
+ #include " util.hpp"
4
+
3
5
#include < iostream>
4
6
#include < fstream>
5
7
#include < cstdlib>
6
8
#include < stdexcept>
7
- #include < dirent.h>
8
9
9
10
namespace avtranscoder
10
11
{
@@ -201,35 +202,4 @@ bool ProfileLoader::checkAudioProfile( const Profile& profileToCheck )
201
202
return isValid;
202
203
}
203
204
204
- void split ( std::vector< std::string >& splitString, const std::string& inputString, const std::string& splitChars )
205
- {
206
- char * part = strtok ( const_cast <char *>( inputString.c_str () ), splitChars.c_str () );
207
- while ( part != NULL )
208
- {
209
- splitString.push_back ( std::string ( part ) );
210
- part = strtok ( NULL , splitChars.c_str () );
211
- }
212
- }
213
-
214
- int getFilesInDir ( const std::string& dir, std::vector< std::string >& files )
215
- {
216
- DIR *dp;
217
- struct dirent *dirp;
218
- if ( ( dp = opendir ( dir.c_str () ) ) == NULL )
219
- {
220
- std::cerr << " Error(" << errno << " ) opening " << dir << std::endl;
221
- return errno;
222
- }
223
-
224
- while ( ( dirp = readdir ( dp ) ) != NULL )
225
- {
226
- std::string filename ( dirp->d_name );
227
- if ( filename == " ." || filename == " .." )
228
- continue ;
229
- files.push_back ( filename );
230
- }
231
- closedir ( dp );
232
- return 0 ;
233
- }
234
-
235
205
}
Original file line number Diff line number Diff line change 4
4
#include < AvTranscoder/common.hpp>
5
5
6
6
#include < string>
7
- #include < cstring>
8
7
#include < vector>
9
8
#include < map>
10
9
@@ -73,10 +72,5 @@ class AvExport ProfileLoader
73
72
Profiles _profiles;
74
73
};
75
74
76
- #ifndef SWIG
77
- void split ( std::vector< std::string >& splitString, const std::string& inputString, const std::string& splitChars = " ;" );
78
- int getFilesInDir ( const std::string& dir, std::vector< std::string >& files );
79
- #endif
80
-
81
75
}
82
76
#endif
Original file line number Diff line number Diff line change
1
+ #ifndef _AV_TRANSCODER_PROFILE_UTIL_HPP_
2
+ #define _AV_TRANSCODER_PROFILE_UTIL_HPP_
3
+
4
+ #include < string>
5
+ #include < dirent.h>
6
+ #include < iostream>
7
+
8
+ namespace avtranscoder
9
+ {
10
+
11
+ void split ( std::vector< std::string >& splitString, const std::string& inputString, const std::string& splitChars )
12
+ {
13
+ char * part = strtok ( const_cast <char *>( inputString.c_str () ), splitChars.c_str () );
14
+ while ( part != NULL )
15
+ {
16
+ splitString.push_back ( std::string ( part ) );
17
+ part = strtok ( NULL , splitChars.c_str () );
18
+ }
19
+ }
20
+
21
+ int getFilesInDir ( const std::string& dir, std::vector< std::string >& files )
22
+ {
23
+ DIR *dp;
24
+ struct dirent *dirp;
25
+ if ( ( dp = opendir ( dir.c_str () ) ) == NULL )
26
+ {
27
+ std::cerr << " Error(" << errno << " ) opening " << dir << std::endl;
28
+ return errno;
29
+ }
30
+
31
+ while ( ( dirp = readdir ( dp ) ) != NULL )
32
+ {
33
+ std::string filename ( dirp->d_name );
34
+ if ( filename == " ." || filename == " .." )
35
+ continue ;
36
+ files.push_back ( filename );
37
+ }
38
+ closedir ( dp );
39
+ return 0 ;
40
+ }
41
+
42
+ }
43
+
44
+ #endif
You can’t perform that action at this time.
0 commit comments