Lucene++ - a full-featured, c++ search engine
API Documentation

Loading...
Searching...
No Matches
NumberTools.h
Go to the documentation of this file.
1
2// Copyright (c) 2009-2014 Alan Wright. All rights reserved.
3// Distributable under the terms of either the Apache License (Version 2.0)
4// or the GNU Lesser General Public License.
6
7#ifndef NUMBERTOOLS_H
8#define NUMBERTOOLS_H
9
10#include "LuceneObject.h"
11
12 namespace Lucene {
13
26 class LPPAPI NumberTools : public LuceneObject {
27 public:
28 virtual ~NumberTools();
29
30 LUCENE_CLASS(NumberTools);
31
32 protected:
33 static const int32_t RADIX;
34
35 static const wchar_t NEGATIVE_PREFIX;
36
37 // NB: NEGATIVE_PREFIX must be < POSITIVE_PREFIX
38 static const wchar_t POSITIVE_PREFIX;
39
40 public:
42 static const String& MIN_STRING_VALUE();
43
45 static const String& MAX_STRING_VALUE();
46
48 static int32_t STR_SIZE();
49
51 static String longToString(int64_t l);
52
54 static int64_t stringToLong(const String& str);
55};
56
57}
58
59#endif
LuceneObject.h
LUCENE_CLASS
#define LUCENE_CLASS(Name)
Definition LuceneObject.h:24
Lucene::LuceneObject::LuceneObject
LuceneObject()
Lucene::NumberTools
Provides support for converting longs to Strings, and back again. The strings are structured so that ...
Definition NumberTools.h:26
Lucene::NumberTools::NEGATIVE_PREFIX
static const wchar_t NEGATIVE_PREFIX
Definition NumberTools.h:35
Lucene::NumberTools::longToString
static String longToString(int64_t l)
Converts a long to a String suitable for indexing.
Lucene::NumberTools::MIN_STRING_VALUE
static const String & MIN_STRING_VALUE()
Equivalent to longToString(LLONG_MIN).
Lucene::NumberTools::stringToLong
static int64_t stringToLong(const String &str)
Converts a String that was returned by longToString back to a long.
Lucene::NumberTools::STR_SIZE
static int32_t STR_SIZE()
The length of (all) strings returned by longToString.
Lucene::NumberTools::~NumberTools
virtual ~NumberTools()
Lucene::NumberTools::POSITIVE_PREFIX
static const wchar_t POSITIVE_PREFIX
Definition NumberTools.h:38
Lucene::NumberTools::RADIX
static const int32_t RADIX
Definition NumberTools.h:33
Lucene::NumberTools::MAX_STRING_VALUE
static const String & MAX_STRING_VALUE()
Equivalent to longToString(LLONG_MAX).
Lucene
Definition AbstractAllTermDocs.h:12

clucene.sourceforge.net