1*e7675e54SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*e7675e54SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*e7675e54SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*e7675e54SAndrew Rist  * distributed with this work for additional information
6*e7675e54SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*e7675e54SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*e7675e54SAndrew Rist  * "License"); you may not use this file except in compliance
9*e7675e54SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*e7675e54SAndrew Rist  *
11*e7675e54SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*e7675e54SAndrew Rist  *
13*e7675e54SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*e7675e54SAndrew Rist  * software distributed under the License is distributed on an
15*e7675e54SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*e7675e54SAndrew Rist  * KIND, either express or implied.  See the License for the
17*e7675e54SAndrew Rist  * specific language governing permissions and limitations
18*e7675e54SAndrew Rist  * under the License.
19*e7675e54SAndrew Rist  *
20*e7675e54SAndrew Rist  *************************************************************/
21*e7675e54SAndrew Rist 
22*e7675e54SAndrew Rist 
23cdf0e10cSrcweir #ifndef GUESS_H
24cdf0e10cSrcweir #define GUESS_H
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #define GUESS_SEPARATOR_OPEN     '['
27cdf0e10cSrcweir #define GUESS_SEPARATOR_CLOSE    ']'
28cdf0e10cSrcweir #define GUESS_SEPARATOR_SEP      '-'
29cdf0e10cSrcweir #define DEFAULT_LANGUAGE         ""
30cdf0e10cSrcweir #define DEFAULT_COUNTRY          ""
31cdf0e10cSrcweir #define DEFAULT_ENCODING         ""
32cdf0e10cSrcweir 
33cdf0e10cSrcweir #include <string>
34cdf0e10cSrcweir 
35cdf0e10cSrcweir using namespace std;
36cdf0e10cSrcweir 
37cdf0e10cSrcweir /**
38cdf0e10cSrcweir @author Jocelyn Merand
39cdf0e10cSrcweir  */
40cdf0e10cSrcweir class Guess{
41cdf0e10cSrcweir     public:
42cdf0e10cSrcweir 
43cdf0e10cSrcweir         /**
44cdf0e10cSrcweir          * Default init
45cdf0e10cSrcweir          */
46cdf0e10cSrcweir         Guess();
47cdf0e10cSrcweir 
48cdf0e10cSrcweir         /**
49cdf0e10cSrcweir          * Init from a string like [en-UK-utf8] and the rank
50cdf0e10cSrcweir          */
51cdf0e10cSrcweir         Guess(char * guess_str);
52cdf0e10cSrcweir 
53cdf0e10cSrcweir         ~Guess();
54cdf0e10cSrcweir 
55cdf0e10cSrcweir         string GetLanguage();
56cdf0e10cSrcweir         string GetCountry();
57cdf0e10cSrcweir         string GetEncoding();
58cdf0e10cSrcweir 
59cdf0e10cSrcweir         bool operator==(string lang);
60cdf0e10cSrcweir 
61cdf0e10cSrcweir     protected:
62cdf0e10cSrcweir         string language_str;
63cdf0e10cSrcweir         string country_str;
64cdf0e10cSrcweir         string encoding_str;
65cdf0e10cSrcweir };
66cdf0e10cSrcweir 
67cdf0e10cSrcweir #endif
68