LCOV - code coverage report
Current view: top level - sc/inc - typedstrdata.hxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 3 6 50.0 %
Date: 2014-11-03 Functions: 4 8 50.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             : 
      10             : #ifndef INCLUDED_SC_INC_TYPEDSTRDATA_HXX
      11             : #define INCLUDED_SC_INC_TYPEDSTRDATA_HXX
      12             : 
      13             : #include <rtl/ustring.hxx>
      14             : #include "scdllapi.h"
      15             : 
      16             : #include <set>
      17             : 
      18         162 : class ScTypedStrData
      19             : {
      20             : public:
      21             :     enum StringType {
      22             :         Value    = 0,
      23             :         Standard = 1,
      24             :         Name     = 2,
      25             :         DbName   = 3,
      26             :         Header   = 4
      27             :     };
      28             : 
      29             :     ScTypedStrData( const OUString& rStr, double nVal = 0.0,
      30             :                     StringType eType = Standard, bool bDate = false );
      31             : 
      32             :     ScTypedStrData( const ScTypedStrData& rCpy );
      33             : 
      34             :     bool IsStrData() const;
      35           0 :     bool IsDate() const { return mbIsDate;}
      36          12 :     const OUString& GetString() const { return maStrValue;}
      37           0 :     StringType GetStringType() const { return meStrType;}
      38          30 :     double GetValue() const { return mfValue; }
      39             : 
      40             :     struct LessCaseSensitive : std::binary_function<ScTypedStrData, ScTypedStrData, bool>
      41             :     {
      42             :         bool operator() (const ScTypedStrData& left, const ScTypedStrData& right) const;
      43             :     };
      44             : 
      45             :     struct LessCaseInsensitive : std::binary_function<ScTypedStrData, ScTypedStrData, bool>
      46             :     {
      47             :         bool operator() (const ScTypedStrData& left, const ScTypedStrData& right) const;
      48             :     };
      49             : 
      50             :     struct EqualCaseSensitive : std::binary_function<ScTypedStrData, ScTypedStrData, bool>
      51             :     {
      52             :         bool operator() (const ScTypedStrData& left, const ScTypedStrData& right) const;
      53             :     };
      54             : 
      55             :     struct EqualCaseInsensitive : std::binary_function<ScTypedStrData, ScTypedStrData, bool>
      56             :     {
      57             :         bool operator() (const ScTypedStrData& left, const ScTypedStrData& right) const;
      58             :     };
      59             : 
      60             :     bool operator== (const ScTypedStrData& r) const;
      61             :     bool operator< (const ScTypedStrData& r) const;
      62             : 
      63             : private:
      64             :     OUString maStrValue;
      65             :     double mfValue;
      66             :     StringType meStrType;
      67             :     bool   mbIsDate;
      68             : };
      69             : 
      70           0 : class FindTypedStrData : std::unary_function<ScTypedStrData, bool>
      71             : {
      72             :     ScTypedStrData maVal;
      73             :     bool mbCaseSens;
      74             : public:
      75             :     FindTypedStrData(const ScTypedStrData& rVal, bool bCaseSens);
      76             :     bool operator() (const ScTypedStrData& r) const;
      77             : };
      78             : 
      79             : typedef std::set<ScTypedStrData, ScTypedStrData::LessCaseSensitive> ScTypedCaseStrSet;
      80             : 
      81             : #endif
      82             : 
      83             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10