Orcus
include
orcus
string_pool.hpp
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
/*
3
* This Source Code Form is subject to the terms of the Mozilla Public
4
* License, v. 2.0. If a copy of the MPL was not distributed with this
5
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
*/
7
8
#ifndef INCLUDED_ORCUS_STRING_POOL_HPP
9
#define INCLUDED_ORCUS_STRING_POOL_HPP
10
11
#include "env.hpp"
12
#include "pstring.hpp"
13
14
#include <string>
15
#include <memory>
16
17
namespace
orcus {
18
22
class
ORCUS_PSR_DLLPUBLIC
string_pool
23
{
24
public
:
25
string_pool
(
const
string_pool
&) =
delete
;
26
string_pool
& operator=(
const
string_pool
&) =
delete
;
27
28
string_pool
();
29
~
string_pool
();
30
40
std::pair<pstring, bool>
intern
(
const
char
* str);
41
51
std::pair<pstring, bool>
intern
(
const
char
* str,
size_t
n);
52
60
std::pair<pstring, bool>
intern
(
const
pstring
& str);
61
62
void
dump()
const
;
63
void
clear();
64
size_t
size()
const
;
65
66
void
swap(
string_pool
& other);
67
77
void
merge
(
string_pool
& other);
78
79
private
:
80
struct
impl;
81
std::unique_ptr<impl> mp_impl;
82
};
83
84
}
85
86
#endif
87
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
orcus::pstring
Definition:
pstring.hpp:28
orcus::string_pool::intern
std::pair< pstring, bool > intern(const char *str, size_t n)
orcus::string_pool::merge
void merge(string_pool &other)
orcus::string_pool
Definition:
string_pool.hpp:23
orcus::string_pool::intern
std::pair< pstring, bool > intern(const pstring &str)
orcus::string_pool::intern
std::pair< pstring, bool > intern(const char *str)
Generated on Tue Jul 28 2020 00:00:00 for Orcus by
1.8.18