bump product version to 4.1.6.2
[LibreOffice.git] / include / cosv / str_types.hxx
blobecf9c997c271a9469931d38342ebc54d5b5aedd2
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef COSV_STR_TYPES_HXX
21 #define COSV_STR_TYPES_HXX
24 namespace csv
27 /** Provides some generally used constants.
29 struct str
31 public:
32 typedef ::size_t position;
33 typedef ::size_t size;
35 static const position npos = -1;
36 static const size maxsize = -1;
38 enum insert_mode
40 overwrite = 0,
41 insert = 1
46 /** Is used for string comparisons.
48 @collab String
49 @collab various csv::compare(...) functions
51 class CharOrder_Table
53 public:
54 /** @precond
55 Parameter i_pCharWeightsArray
56 must have size of 256.
58 CharOrder_Table(
59 const int * i_pCharWeightsArray );
61 /** @return the weight of the char i_c.
62 @precond
63 Even with unusual implementations, where char has more than 8 bit,
64 there must be true: 0 <= i_c < 256.
66 int operator()(
67 char i_c ) const;
68 private:
69 int cWeights[256];
73 // IMPLEMENTATION
75 inline int
76 CharOrder_Table::operator()( char i_c ) const
77 { return cWeights[ UINT8(i_c) ]; }
81 } // namespace csv
83 #endif
85 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */