File tree Expand file tree Collapse file tree 4 files changed +36
-40
lines changed Expand file tree Collapse file tree 4 files changed +36
-40
lines changed Original file line number Diff line number Diff line change 6
6
#include < fstream>
7
7
#include < cstdlib>
8
8
#include < stdexcept>
9
+ #include < dirent.h>
9
10
10
11
namespace avtranscoder
11
12
{
@@ -200,5 +201,35 @@ bool ProfileLoader::checkAudioProfile( const Profile& profileToCheck )
200
201
return isValid;
201
202
}
202
203
204
+ void split ( std::vector< std::string >& splitedString, 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
+ splitedString.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
+ }
203
234
204
235
}
Original file line number Diff line number Diff line change @@ -73,5 +73,10 @@ class AvExport ProfileLoader
73
73
Profiles _profiles;
74
74
};
75
75
76
+ #ifndef SWIG
77
+ void split ( std::vector< std::string >& splitedString, const std::string& inputString, const std::string& splitChars = " ;" );
78
+ int getFilesInDir ( const std::string& dir, std::vector< std::string >& files );
79
+ #endif
80
+
76
81
}
77
82
#endif
Original file line number Diff line number Diff line change @@ -6,9 +6,6 @@ extern "C" {
6
6
#include < libavutil/error.h>
7
7
}
8
8
9
- #include < dirent.h>
10
- #include < iostream>
11
-
12
9
namespace avtranscoder
13
10
{
14
11
@@ -22,37 +19,6 @@ void setLogLevel( const int level )
22
19
av_log_set_level ( level );
23
20
}
24
21
25
- void split ( std::vector< std::string >& splitedString, const std::string& inputString, const std::string& splitChars )
26
- {
27
- char * part = strtok ( const_cast <char *>( inputString.c_str () ), splitChars.c_str () );
28
- while ( part != NULL )
29
- {
30
- splitedString.push_back ( std::string ( part ) );
31
- part = strtok ( NULL , splitChars.c_str () );
32
- }
33
- }
34
-
35
- int getFilesInDir ( const std::string& dir, std::vector< std::string >& files )
36
- {
37
- DIR *dp;
38
- struct dirent *dirp;
39
- if ( ( dp = opendir ( dir.c_str () ) ) == NULL )
40
- {
41
- std::cerr << " Error(" << errno << " ) opening " << dir << std::endl;
42
- return errno;
43
- }
44
-
45
- while ( ( dirp = readdir ( dp ) ) != NULL )
46
- {
47
- std::string filename ( dirp->d_name );
48
- if ( filename == " ." || filename == " .." )
49
- continue ;
50
- files.push_back ( filename );
51
- }
52
- closedir ( dp );
53
- return 0 ;
54
- }
55
-
56
22
std::string getFormat ( const std::string& filename )
57
23
{
58
24
std::string format ( " " );
Original file line number Diff line number Diff line change @@ -18,7 +18,6 @@ extern "C" {
18
18
19
19
#include < string>
20
20
#include < cstring>
21
- #include < vector>
22
21
23
22
#ifdef SWIG
24
23
#define AvExport
@@ -66,11 +65,6 @@ void AvExport preloadCodecsAndFormats();
66
65
*/
67
66
void AvExport setLogLevel ( const int level );
68
67
69
- #ifndef SWIG
70
- void split ( std::vector< std::string >& splitedString, const std::string& inputString, const std::string& splitChars = " ;" );
71
- int getFilesInDir ( const std::string& dir, std::vector< std::string >& files );
72
- #endif
73
-
74
68
std::string AvExport getFormat ( const std::string& filename );
75
69
bool AvExport matchFormat ( const std::string& format, const std::string& filename );
76
70
You can’t perform that action at this time.
0 commit comments