include/relpipe/common/RelpipeException.h
branchv_0
changeset 19 2999fca726f3
parent 18 9d566568d37c
child 28 71114e5a0b6e
equal deleted inserted replaced
18:9d566568d37c 19:2999fca726f3
       
     1 /**
       
     2  * Relational pipes (library)
       
     3  * Copyright © 2019 František Kučera (Frantovo.cz, GlobalCode.info)
       
     4  *
       
     5  * This program is free software: you can redistribute it and/or modify
       
     6  * it under the terms of the:
       
     7  *  - GNU Lesser General Public License as published by the Free Software Foundation;
       
     8  *    version 3 of the License or (at your option)
       
     9  *  - GNU General Public License as published by the Free Software Foundation;
       
    10  *    version 2 of the License.
       
    11  *
       
    12  * This program is distributed in the hope that it will be useful,
       
    13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
       
    15  * GNU General Public License for more details.
       
    16  *
       
    17  * You should have received a copy of the GNU General Public License
       
    18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
       
    19  */
       
    20 #pragma once
       
    21 
       
    22 #include <string.h>
       
    23 #include <iconv.h>
       
    24 #include <string>
       
    25 #include <array>
       
    26 #include <assert.h>
       
    27 #include <ostream>
       
    28 #include <sstream>
       
    29 
       
    30 namespace relpipe {
       
    31 namespace common {
       
    32 
       
    33 /**
       
    34  * RelpipeException class is a simple wrapper for iconv() functions.
       
    35  * It converts text from one encoding to another.
       
    36  * 
       
    37  * List of all encodings: iconv --list
       
    38  * 
       
    39  * n.b. if the default (platform) encoding "" is used, it is required to initialize locales: setlocale(LC_ALL, "");
       
    40  */
       
    41 class RelpipeException {
       
    42 private:
       
    43 	class RelpipeExceptionInternal;
       
    44 	RelpipeExceptionInternal* internal;
       
    45 public:
       
    46 	RelpipeException(std::string message);
       
    47 	virtual ~RelpipeException();
       
    48 	virtual std::string getMessge();
       
    49 };
       
    50 
       
    51 }
       
    52 }