1
// ---------------------------------------------------------------------------
3
// - standard object library - quark zone class definition -
4
// ---------------------------------------------------------------------------
5
// - This program is free software; you can redistribute it and/or modify -
6
// - it provided that this copyright notice is kept intact. -
8
// - This program is distributed in the hope that it will be useful, but -
9
// - without any warranty; without even the implied warranty of -
10
// - merchantability or fitness for a particular purpose. In no event shall -
11
// - the copyright holder be liable for any direct, indirect, incidental or -
12
// - special damages arising in any way out of the use of this software. -
13
// ---------------------------------------------------------------------------
14
// - copyright (c) 1999-2011 amaury darsch -
15
// ---------------------------------------------------------------------------
17
#ifndef AFNIX_QUARKZONE_HPP
18
#define AFNIX_QUARKZONE_HPP
20
#ifndef AFNIX_STRING_HPP
26
/// The QuarkZone class is an administrative class designed to manage
27
/// the class quarks. The class is fed by adding quark in the form of
28
/// string internation. Once created, a quark is locally stored by the
29
/// zone which can report whether or not a quark exists
30
/// @author amaury darsch
38
/// the array of quark
42
/// create an empty quark zone
45
/// create a quark zone with an initial size
46
/// @param size the initial size
47
QuarkZone (const long size);
49
/// copy construct this quark zone
50
QuarkZone (const QuarkZone& that);
52
/// destroy the quark zone.
55
/// assign a quark zone to this one
56
QuarkZone& operator = (const QuarkZone& that);
58
/// reset the quark zone
61
/// @return the number of elements
62
long length (void) const;
64
/// @return true if the quark exists
65
bool exists (const long quark) const;
67
/// intern the string argument and return the associated quark
68
/// @param value the string to intern
69
long intern (const String& value);
71
/// @return the interned quark by index
72
long get (const long index) const;
74
/// @return the interned string by index
75
String tostring (const long index) const;