LCOV - code coverage report
Current view: top level - libreoffice/solver/unxlngi6.pro/inc/cosv - str_types.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 2 2 100.0 %
Date: 2012-12-27 Functions: 1 1 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       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/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      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 .
      18             :  */
      19             : 
      20             : #ifndef COSV_STR_TYPES_HXX
      21             : #define COSV_STR_TYPES_HXX
      22             : 
      23             : 
      24             : namespace csv
      25             : {
      26             : 
      27             : /** Provides some generally used constants.
      28             : */
      29             : struct str
      30             : {
      31             :   public:
      32             :     typedef ::size_t    position;
      33             :     typedef ::size_t    size;
      34             : 
      35             :     static const position npos = -1;
      36             :     static const size maxsize = -1;
      37             : 
      38             :     enum insert_mode
      39             :     {
      40             :         overwrite = 0,
      41             :         insert = 1
      42             :     };
      43             : };
      44             : 
      45             : 
      46             : /** Is used for string comparisons.
      47             : 
      48             :     @collab String
      49             :     @collab various csv::compare(...) functions
      50             : */
      51             : class CharOrder_Table
      52             : {
      53             :   public:
      54             :     /** @precond
      55             :         Parameter i_pCharWeightsArray
      56             :         must have size of 256.
      57             :     */
      58             :                         CharOrder_Table(
      59             :                             const int *         i_pCharWeightsArray );
      60             : 
      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.
      65             :     */
      66             :     int                 operator()(
      67             :                             char                i_c ) const;
      68             :   private:
      69             :     int                 cWeights[256];
      70             : };
      71             : 
      72             : 
      73             : // IMPLEMENTATION
      74             : 
      75             : inline int
      76     4034174 : CharOrder_Table::operator()( char i_c ) const
      77     4034174 :     { return cWeights[ UINT8(i_c) ]; }
      78             : 
      79             : 
      80             : 
      81             : }   // namespace csv
      82             : 
      83             : #endif
      84             : 
      85             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10