| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
#include <string.h> |
| 18 |
#include <iostream> |
| 19 |
using namespace std; |
| 20 |
|
| 21 |
class EncoderFormat |
| 22 |
{ |
| 23 |
public: |
| 24 |
const string get() |
| 25 |
{ |
| 26 |
return(string(_format.begin(),_format.end())); |
| 27 |
} |
| 28 |
|
| 29 |
void set(const wstring fileName) |
| 30 |
{ |
| 31 |
wstring |
| 32 |
format; |
| 33 |
|
| 34 |
size_t |
| 35 |
index; |
| 36 |
|
| 37 |
if (fileName.find(L"clusterfuzz-testcase-") == -1) |
| 38 |
return; |
| 39 |
|
| 40 |
format=fileName; |
| 41 |
index=format.find(L"_", 0); |
| 42 |
if (index == wstring::npos) |
| 43 |
return; |
| 44 |
|
| 45 |
format=format.substr(index+1); |
| 46 |
index=format.find(L"_",0); |
| 47 |
if (index != wstring::npos) |
| 48 |
_format=format.substr(0, index); |
| 49 |
} |
| 50 |
private: |
| 51 |
wstring _format=L".notset"; |
| 52 |
}; |