imgtools/imgcheck/inc/cmdlinewriter.h
changeset 620 ad8ffc8e1982
parent 590 360bd6b35136
equal deleted inserted replaced
585:238f4cb8391f 620:ad8ffc8e1982
    26 #include "common.h"
    26 #include "common.h"
    27 
    27 
    28 /**
    28 /**
    29 Constants for Cmd Line report section.
    29 Constants for Cmd Line report section.
    30 */
    30 */
    31 const String KCmdHeader(" Executable		Attribute	Value                   Status");
    31  
    32 const String KCmdLineDelimiter("-------------------------------------------------------------------------------");
    32 const char KCmdLineDelimiter[] = "-------------------------------------------------------------------------------"; 
    33 const String KCmdHeaderNoStatus(" Executable		Attribute	Value         ");
    33 const char KCmdLineDelimiterNoStatus[] = "--------------------------------------------------";
    34 const String KCmdLineDelimiterNoStatus("--------------------------------------------------");
    34 const char KCmdImageName[] = "Image Name: ";
    35 const String KCmdImageName("Image Name: ");
    35 const char KCmdLine[] = "Command line"; 
    36 const String KCmdLine("Command line");
    36  
    37 const int KCmdGenBufferSize=260;
       
    38 // width to fill the values displayed as 0x00000056
       
    39 const unsigned int KCmdFormatEightWidth = 8;
       
    40 // width to print the attribute names
    37 // width to print the attribute names
    41 const unsigned int KCmdFormatTwelveWidth = 12;
    38 const unsigned int KCmdFormatTwelveWidth = 12; 
    42 // width to print the executable names and attribute names when executable name is not emitted
    39 // width to print the executable names and attribute names when executable name is not emitted
    43 const unsigned int KCmdFormatTwentyTwoWidth = 22;
       
    44 //width to print the status after the attribute values are printed for SID and VID
    40 //width to print the status after the attribute values are printed for SID and VID
    45 const unsigned int KCmdFormatThirtyWidth = 30;
    41 const unsigned int KCmdFormatTwentyEightWidth = 28;
    46 // this check is taken for formatting the values (like SID and VID) other that the dependency names.
    42 // this check is taken for formatting the values (like SID and VID) other that the dependency names.
    47 const String KCmdDepName("Dependency");
    43 const char KCmdDepName[] = "Dependency";
    48 const String KCmdDbgName("DBG");
    44 const char KCmdDbgName[] = "DBG";
    49 const String KCmdDbgDisplayName("Debug Flag");
    45 const char KCmdDbgDisplayName[] = "Debug Flag";
    50 
    46 
    51 typedef std::stringstream OstrStream;
    47  
    52 
    48 
    53 /** 
    49 /** 
    54 class command line writer
    50 class command line writer
    55 
    51 
    56 @internalComponent
    52 @internalComponent
    62 
    58 
    63 	CmdLineWriter(unsigned int aInputOptions);
    59 	CmdLineWriter(unsigned int aInputOptions);
    64 	~CmdLineWriter(void);
    60 	~CmdLineWriter(void);
    65 	void StartReport(void);
    61 	void StartReport(void);
    66 	void EndReport(void);
    62 	void EndReport(void);
    67 	void StartImage(const String& aImageName);
    63 	void StartImage(const string& aImageName);
    68 	void EndImage(void);
    64 	void EndImage(void);
    69 	void StartExecutable(const unsigned int aSerNo, const String& aExeName);
    65 	void StartExecutable(const unsigned int aSerNo, const string& aExeName);
    70 	void EndExecutable(void);
    66 	void EndExecutable(void);
    71   	
    67   	
    72    	void FormatAndWriteElement(const String& aElement);
    68    	void FormatAndWriteElement(const string& aElement);
    73 	void WriteExeAttribute(ExeAttribute& aOneSetExeAtt);
    69 	void WriteExeAttribute(ExeAttribute& aOneSetExeAtt);
    74 	void WriteDelimiter(void);
    70 	void WriteDelimiter(void);
    75 	void WriteNote(void);
    71 	void WriteNote(void);
    76 	const String& ReportType(void);
    72 	const string& ReportType(void);
    77 
    73 
    78 private:
    74 private:
    79 	
    75 	
    80 	// Output streams for cmd line output.
    76 	// Output streams for cmd line output.
    81 	OstrStream iFormatMessage;
    77 	stringstream iFormatMessage;
    82 	// For Dependencies align.
    78 	// For Dependencies align.
    83 	bool iForDepAlign;
    79 	bool iForDepAlign;
    84 	// For formating purpose.
    80 	// For formating purpose.
    85 	unsigned int iFormatSize;
    81 	unsigned int iFormatSize; 
    86 	// Buffer pointer for formating purpose.
       
    87 	char* iBuffer;
       
    88 	//Hold the report type
    82 	//Hold the report type
    89 	String iRptType;
    83 	string iRptType;
    90 	//Contains the input options
    84 	//Contains the input options
    91 	unsigned int iCmdOptions;
    85 	unsigned int iCmdOptions;
    92 };
    86 };
    93 
    87 
    94 #endif // CMDLINEWRITER_H
    88 #endif // CMDLINEWRITER_H