mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 20:03:03 +01:00
Misc
This commit is contained in:
parent
e61dad78e7
commit
e13a0e3865
@ -135,6 +135,7 @@ ClumpletReader::ClumpletReader(const KindList* kl, const UCHAR* buffer, size_t b
|
||||
}
|
||||
++kl;
|
||||
}
|
||||
|
||||
if (kl->kind == EndOfList)
|
||||
{
|
||||
if (raise)
|
||||
@ -144,6 +145,7 @@ ClumpletReader::ClumpletReader(const KindList* kl, const UCHAR* buffer, size_t b
|
||||
invalid_structure("Unknown tag value - missing in the list of possible");
|
||||
}
|
||||
}
|
||||
|
||||
rewind(); // this will set cur_offset and spbState
|
||||
}
|
||||
|
||||
@ -714,4 +716,3 @@ const ClumpletReader::KindList ClumpletReader::dpbList[] = {
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
||||
|
@ -46,11 +46,13 @@ class ClumpletReader : protected AutoStorage
|
||||
{
|
||||
public:
|
||||
enum Kind {EndOfList, Tagged, UnTagged, SpbAttach, SpbStart, Tpb/*, SpbInfo*/, WideTagged, WideUnTagged, SpbItems};
|
||||
|
||||
struct KindList
|
||||
{
|
||||
Kind kind;
|
||||
UCHAR tag;
|
||||
};
|
||||
|
||||
struct SingleClumplet
|
||||
{
|
||||
UCHAR tag;
|
||||
@ -151,12 +153,10 @@ private:
|
||||
|
||||
static SINT64 fromVaxInteger(const UCHAR* ptr, size_t length);
|
||||
|
||||
// Some frequently used kind lists
|
||||
public:
|
||||
static const KindList dpbList[];
|
||||
static const KindList dpbList[]; // Some frequently used kind lists
|
||||
};
|
||||
|
||||
} // namespace Firebird
|
||||
|
||||
#endif // CLUMPLETREADER_H
|
||||
|
||||
|
@ -118,7 +118,8 @@ ClumpletWriter::ClumpletWriter(MemoryPool& given_pool, Kind k, size_t limit,
|
||||
}
|
||||
rewind();
|
||||
}
|
||||
*/
|
||||
*/
|
||||
|
||||
void ClumpletWriter::reset(UCHAR tag)
|
||||
{
|
||||
if (kindList)
|
||||
@ -435,6 +436,7 @@ bool ClumpletWriter::upgradeVersion()
|
||||
newest = itr;
|
||||
}
|
||||
}
|
||||
|
||||
if (getBufferLength() && newest->tag <= getBufferTag())
|
||||
{
|
||||
return false;
|
||||
|
@ -49,7 +49,7 @@ public:
|
||||
|
||||
// Create writer from a given buffer
|
||||
ClumpletWriter(Kind k, size_t limit, const UCHAR* buffer, size_t buffLen, UCHAR tag);
|
||||
// ClumpletWriter(MemoryPool& pool, Kind k, size_t limit, const UCHAR* buffer, size_t buffLen, UCHAR tag);
|
||||
//ClumpletWriter(MemoryPool& pool, Kind k, size_t limit, const UCHAR* buffer, size_t buffLen, UCHAR tag);
|
||||
|
||||
// Create writer from a given buffer with possibly different clumplet version
|
||||
ClumpletWriter(const KindList* kl, size_t limit, const UCHAR* buffer = NULL, size_t buffLen = 0);
|
||||
@ -81,12 +81,13 @@ public:
|
||||
bool deleteWithTag(UCHAR tag);
|
||||
|
||||
virtual const UCHAR* getBuffer() const;
|
||||
|
||||
protected:
|
||||
virtual const UCHAR* getBufferEnd() const;
|
||||
virtual void size_overflow();
|
||||
void insertBytesLengthCheck(UCHAR tag, const UCHAR* bytes, const size_t length);
|
||||
// upgrade clumplet version - obtain newest from kindList
|
||||
bool upgradeVersion();
|
||||
bool upgradeVersion(); // upgrade clumplet version - obtain newest from kindList
|
||||
|
||||
private:
|
||||
size_t sizeLimit;
|
||||
const KindList* kindList;
|
||||
@ -104,4 +105,3 @@ private:
|
||||
} // namespace Firebird
|
||||
|
||||
#endif // CLUMPLETWRITER_H
|
||||
|
||||
|
@ -65,7 +65,7 @@ public:
|
||||
};
|
||||
|
||||
|
||||
template <typename T> // Generic clear for TriState
|
||||
template <typename T> // Generic TriStateClear
|
||||
class TriStateClear
|
||||
{
|
||||
public:
|
||||
@ -76,7 +76,7 @@ public:
|
||||
};
|
||||
|
||||
template <>
|
||||
class TriStateClear<Firebird::string> // string especialization to clear TriState
|
||||
class TriStateClear<Firebird::string> // string especialization for TriStateClear
|
||||
{
|
||||
public:
|
||||
static void clear(Firebird::string& v)
|
||||
@ -86,7 +86,7 @@ public:
|
||||
};
|
||||
|
||||
template <>
|
||||
class TriStateClear<Firebird::MetaName> // MetaName especialization to clear TriState
|
||||
class TriStateClear<Firebird::MetaName> // MetaName especialization for TriStateClear
|
||||
{
|
||||
public:
|
||||
static void clear(Firebird::MetaName& v)
|
||||
|
@ -4752,7 +4752,8 @@ static void find_intl_charset(thread_db* tdbb, Jrd::Attachment* attachment, cons
|
||||
}
|
||||
}
|
||||
|
||||
namespace {
|
||||
namespace
|
||||
{
|
||||
void dpbErrorRaise()
|
||||
{
|
||||
ERR_post(Arg::Gds(isc_bad_dpb_form) <<
|
||||
|
Loading…
Reference in New Issue
Block a user