Magick++ 7.1.1
Loading...
Searching...
No Matches
encoder_format.h
1/*
2 Copyright @ 2018 ImageMagick Studio LLC, a non-profit organization
3 dedicated to making software imaging solutions freely available.
4
5 You may not use this file except in compliance with the License. You may
6 obtain a copy of the License at
7
8 https://imagemagick.org/script/license.php
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15*/
16
17#include <string.h>
18#include <iostream>
19using namespace std;
20
21extern class EncoderFormat
22{
23public:
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 }
50private:
51 wstring _format=L".notset";
52};