2
* PROGRAM: Client/Server Common Code
4
* DESCRIPTION: metadata name holder
6
* The contents of this file are subject to the Initial
7
* Developer's Public License Version 1.0 (the "License");
8
* you may not use this file except in compliance with the
9
* License. You may obtain a copy of the License at
10
* http://www.ibphoenix.com/main.nfs?a=ibphoenix&page=ibp_idpl.
12
* Software distributed under the License is distributed AS IS,
13
* WITHOUT WARRANTY OF ANY KIND, either express or implied.
14
* See the License for the specific language governing rights
15
* and limitations under the License.
17
* The Original Code was created by Alexander Peshkov
18
* for the Firebird Open Source RDBMS project.
20
* Copyright (c) 2005 Alexander Peshkov <peshkoff@mail.ru>
21
* and all contributors signed below.
23
* All Rights Reserved.
24
* Contributor(s): ______________________________________.
33
#include "../common/classes/MetaName.h"
37
MetaName& MetaName::assign(const char* s, size_t l)
52
int MetaName::compare(const char* s, size_t l) const
57
size_t x = length() < l ? length() : l;
58
int rc = memcmp(c_str(), s, x);
67
void MetaName::adjustLength(const char* const s, size_t& l)
70
if (l > MAX_SQL_IDENTIFIER_LEN)
72
l = MAX_SQL_IDENTIFIER_LEN;
84
void MetaName::upper7()
86
for (char* p = data; *p; p++)
92
void MetaName::lower7()
94
for (char* p = data; *p; p++)
100
void MetaName::printf(const char* format, ...)
104
va_start(params, format);
105
int l = VSNPRINTF(data, MAX_SQL_IDENTIFIER_LEN, format, params);
106
if (l < 0 || size_t(l) > MAX_SQL_IDENTIFIER_LEN)
108
l = MAX_SQL_IDENTIFIER_LEN;
115
char* MetaName::getBuffer(size_t l)
117
fb_assert (l < MAX_SQL_IDENTIFIER_SIZE);
123
} // namespace Firebird