dbgsrv/coredumpserver/plugins/formatters/symbianelf/inc/symbianelfstringinfo.h
changeset 0 c6b0df440bee
equal deleted inserted replaced
-1:000000000000 0:c6b0df440bee
       
     1 // Copyright (c) 2007-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 // Implements handling of the string info segment in Elf core dump
       
    15 // Definition of the string info table.
       
    16 //
       
    17 
       
    18 
       
    19 
       
    20 /**
       
    21  @file
       
    22  @internalTechnology
       
    23  @released
       
    24 */
       
    25 
       
    26 #ifndef __SYMBIAN_STRING_INFO_H__
       
    27 #define __SYMBIAN_STRING_INFO_H__
       
    28 
       
    29 _LIT8(KEmpty, "");
       
    30 _LIT8(KSymbian, "CORE.SYMBIAN");
       
    31 _LIT8(KThread, "CORE.SYMBIAN.THREAD");
       
    32 _LIT8(KProcess, "CORE.SYMBIAN.PROCESS");
       
    33 _LIT8(KExecutable, "CORE.SYMBIAN.EXECUTABLE");
       
    34 _LIT8(KStr, "CORE.SYMBIAN.STR");
       
    35 _LIT8(KSymbianElfCoreDumpVersion, "1.0.0");
       
    36 _LIT8(KSymbianTraceVersion, "1.0.0");
       
    37 
       
    38 /**
       
    39 @internalTechnology
       
    40 @released
       
    41 
       
    42 String info table is used by symbian elf formatter to manage the string segment data.
       
    43 */
       
    44 class CStringInfoTable : public CBase
       
    45 {
       
    46 public:
       
    47 	static CStringInfoTable *NewL();
       
    48 	static CStringInfoTable *NewLC();
       
    49 	~CStringInfoTable();
       
    50 
       
    51 public:
       
    52 	TUint GetIndex(const TDesC8 &aItem);
       
    53 	TUint AddStringL(const TDesC8 &aItem);
       
    54 	TText8* GetAllStrings();
       
    55 	TUint GetSize();
       
    56 
       
    57 private:
       
    58 	void ConstructL();
       
    59 	CStringInfoTable();
       
    60     /** internal buffer holding the content of the string table */
       
    61 	RBuf8 iBuffer;
       
    62 };
       
    63 
       
    64 /**
       
    65 Called when willing to locate the index of the specified text in the internal buffer
       
    66 @param aItem descriptor holding the text to locate
       
    67 @return index of the located text in the internall buffer
       
    68 */
       
    69 inline TUint CStringInfoTable::GetIndex(const TDesC8 &aItem)
       
    70 {
       
    71 	return iBuffer.Find(aItem);
       
    72 }
       
    73 
       
    74 /**
       
    75 Called when required to get the raw content of the string table
       
    76 @return pointer to the content of the internal buffer
       
    77 */
       
    78 inline TText8* CStringInfoTable::GetAllStrings()
       
    79 {
       
    80 	return (TText8*)iBuffer.Ptr();
       
    81 }
       
    82 
       
    83 /**
       
    84 Called when required to get the size of the string table
       
    85 @return size of the internal buffer
       
    86 */
       
    87 inline TUint CStringInfoTable::GetSize()
       
    88 {
       
    89 	return iBuffer.Length();
       
    90 }
       
    91 
       
    92 #endif // __SYMBIAN_STRING_INFO_H__