equal
deleted
inserted
replaced
|
1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #include "elf_string_table.h" |
|
17 #include <cassert> |
|
18 |
|
19 namespace elf |
|
20 { |
|
21 const char* String_table::get_string(unsigned n) const |
|
22 { |
|
23 return (m_first_p + n); |
|
24 } |
|
25 |
|
26 String_table::String_table(const char* p, unsigned size) |
|
27 : m_first_p(p), m_last_p(p + size - 1) |
|
28 { |
|
29 assert(m_first_p <= m_last_p); |
|
30 |
|
31 if (*m_first_p != '\0') |
|
32 { |
|
33 //throw String_table_error("the first character is non-NUL"); |
|
34 assert(0); |
|
35 } |
|
36 |
|
37 if (*m_last_p != '\0') |
|
38 { |
|
39 //throw String_table_error("the last character is non-NUL"); |
|
40 assert(0); |
|
41 } |
|
42 } |
|
43 } |
|
44 |