dbgsrv/coredumpserver/plugins/formatters/symbianelf/incv2/symbianelfstringinfov2.h
author ravikurupati
Tue, 02 Mar 2010 10:33:16 +0530
changeset 0 c6b0df440bee
permissions -rw-r--r--
Initial contribution of EPL licensed sources
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
     1
// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
     2
// All rights reserved.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
     3
// This component and the accompanying materials are made available
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
     4
// under the terms of "Eclipse Public License v1.0"
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
     5
// which accompanies this distribution, and is available
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
     7
//
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
     8
// Initial Contributors:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
     9
// Nokia Corporation - initial contribution.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    10
//
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    11
// Contributors:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    12
//
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    13
// Description:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    14
// Implements handling of the string info segment in Elf core dump
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    15
// Definition of the string info table.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    16
//
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    17
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    18
/**
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    19
 @file
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    20
 @internalTechnology
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    21
 @released
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    22
*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    23
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    24
#ifndef __SYMBIAN_STRING_INFOV2_H__
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    25
#define __SYMBIAN_STRING_INFOV2_H__
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    26
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    27
_LIT8(KSymbianElfCoreDumpVersionV2, "2.0.0");
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    28
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    29
/**
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    30
@internalTechnology
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    31
@released
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    32
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    33
String info table is used by symbian elf formatter to manage the string segment data.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    34
*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    35
class CStringInfoTableV2 : public CBase
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    36
{
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    37
public:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    38
	static CStringInfoTableV2* NewL();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    39
	static CStringInfoTableV2* NewLC();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    40
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    41
	static CStringInfoTableV2* NewL(const TDesC8& aStrings);
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    42
	static CStringInfoTableV2* NewLC(const TDesC8& aStrings);
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    43
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    44
	~CStringInfoTableV2();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    45
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    46
public:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    47
	TUint GetIndex(const TDesC8 &aItem);
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    48
	TUint AddStringL(const TDesC8 &aItem);
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    49
	TText8* GetAllStrings();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    50
	TUint GetSize();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    51
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    52
private:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    53
	void ConstructL();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    54
	void ConstructL(const TDesC8& aStrings);
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    55
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    56
	CStringInfoTableV2();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    57
    /** internal buffer holding the content of the string table */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    58
	RBuf8 iBuffer;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    59
};
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    60
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    61
/**
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    62
Called when willing to locate the index of the specified text in the internal buffer
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    63
@param aItem descriptor holding the text to locate
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    64
@return index of the located text in the internall buffer
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    65
*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    66
inline TUint CStringInfoTableV2::GetIndex(const TDesC8 &aItem)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    67
{
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    68
	return iBuffer.Find(aItem);
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    69
}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    70
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    71
/**
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    72
Called when required to get the raw content of the string table
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    73
@return pointer to the content of the internal buffer
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    74
*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    75
inline TText8* CStringInfoTableV2::GetAllStrings()
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    76
{
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    77
	return (TText8*)iBuffer.Ptr();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    78
}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    79
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    80
/**
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    81
Called when required to get the size of the string table
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    82
@return size of the internal buffer
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    83
*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    84
inline TUint CStringInfoTableV2::GetSize()
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    85
{
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    86
	return iBuffer.Length();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    87
}
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    88
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    89
#endif // __SYMBIAN_STRING_INFOV2_H__