Annotation of parser3/src/main/pa_charsets.C, revision 1.2
1.1 paf 1: /** @file
2: Parser: sql driver manager implementation.
3:
4: Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com)
5: Author: Alexander Petrosyan <paf@design.ru> (http://paf.design.ru)
6:
1.2 ! paf 7: $Id: pa_charsets.C,v 1.1 2001/12/15 21:28:21 paf Exp $
1.1 paf 8: */
9:
10: #include "pa_charsets.h"
11: #include "pa_charset.h"
12:
13: // globals
14:
15: Charsets *charsets;
16:
17: //
18:
19: Charsets::Charsets(Pool& apool) : Hash(apool) {
20: }
21:
22: static void destroy_charset(const Hash::Key& key, Hash::Val *& value, void *) {
23: static_cast<Charset *>(value)->~Charset();
24: }
25:
26: Charsets::~Charsets() {
27: for_each(destroy_charset);
28: }
29:
1.2 ! paf 30: Charset& Charsets::get_charset(const String& name) {
! 31: if(Charset *result=(Charset *)get(name))
! 32: return *result;
! 33: else
! 34: throw Exception(0, 0,
! 35: &name,
! 36: "unknown charset");
! 37: }
E-mail: