# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1263841985 -7200 # Node ID b700e12870cac2b5f8ba87d595252cfc9b3e58c1 # Parent f58d6ec98e8817d13218ec1ef2b178c3c36b4f8c Revision: 201001 Kit: 201003 diff -r f58d6ec98e88 -r b700e12870ca aknlayoutcompiler/group/AknLayoutCompiler.mmp --- a/aknlayoutcompiler/group/AknLayoutCompiler.mmp Thu Dec 17 09:14:18 2009 +0200 +++ b/aknlayoutcompiler/group/AknLayoutCompiler.mmp Mon Jan 18 21:13:05 2010 +0200 @@ -23,7 +23,9 @@ SYSTEMINCLUDE . SYSTEMINCLUDE ../inc SYSTEMINCLUDE ../../inc -SYSTEMINCLUDE ../../inc/arabica + +SYSTEMINCLUDE ../../toollibraries/arabica/include +SYSTEMINCLUDE ../../toollibraries/xerces-c/include MW_LAYER_SYSTEMINCLUDE @@ -31,6 +33,7 @@ // line builds. STL code generates too many warnings at level 4, but is clean at // level 3. Also require RTTI. option MSVC /GX /W3 /GR +option GCC -DXML_LIBRARY SOURCEPATH ../src @@ -76,31 +79,35 @@ source ZoomLevelNames.cpp source MasterLayoutPack.cpp -#ifndef SBSV2 - start CW32 - win32_library /epoc32/release/cwtools/rel/CdlCompilerToolkit.lib - end +// #ifndef SBSV2 +// start CW32 +// win32_library /epoc32/release/cwtools/rel/CdlCompilerToolkit.lib +// end - start VC32 - win32_library /epoc32/release/tools/rel/CdlCompilerToolkit.lib - end -#else - START TOOLS - #if defined(CW32) - win32_library /epoc32/release/cwtools/rel/CdlCompilerToolkit.lib - #elif defined(VC32) - win32_library /epoc32/release/tools/rel/CdlCompilerToolkit.lib - #endif - END -#endif +// start VC32 +// win32_library /epoc32/release/tools/rel/CdlCompilerToolkit.lib +// end +// #else +// START TOOLS +// #if defined(CW32) +// win32_library /epoc32/release/cwtools/rel/CdlCompilerToolkit.lib +// #elif defined(VC32) +// win32_library /epoc32/release/tools/rel/CdlCompilerToolkit.lib +// #endif +// END +// #endif -start TOOLS -#ifdef RD_XML_PARSER_TOOLCHAIN -win32_library /epoc32/release/tools/rel/Arabica.lib -win32_library /epoc32/release/tools/rel/xerces-c_2.lib -#endif -win32_library Advapi32.lib -end +// start TOOLS +// #ifdef RD_XML_PARSER_TOOLCHAIN +// win32_library /epoc32/release/tools/rel/Arabica.lib +// win32_library /epoc32/release/tools/rel/xerces-c_2.lib +// #endif +// win32_library Advapi32.lib +// end + +staticlibrary CdlCompilerToolkit +staticlibrary arabica +staticlibrary xerces-c // End of File diff -r f58d6ec98e88 -r b700e12870ca aknlayoutcompiler/group/bld.inf --- a/aknlayoutcompiler/group/bld.inf Thu Dec 17 09:14:18 2009 +0200 +++ b/aknlayoutcompiler/group/bld.inf Mon Jan 18 21:13:05 2010 +0200 @@ -19,7 +19,7 @@ #include PRJ_PLATFORMS -TOOLS CWTOOLS +TOOLS CWTOOLS TOOLS2 PRJ_EXPORTS @@ -27,7 +27,7 @@ PRJ_MMPFILES -#if defined(TOOLS) || defined(CWTOOLS) +#if defined(TOOLS2) || defined(TOOLS) || defined(CWTOOLS) /* * NOTICE! AknLayoutCompiler is not compiled any more during usual build. diff -r f58d6ec98e88 -r b700e12870ca aknlayoutcompiler/inc/AdaptationLayerTemplate.h --- a/aknlayoutcompiler/inc/AdaptationLayerTemplate.h Thu Dec 17 09:14:18 2009 +0200 +++ b/aknlayoutcompiler/inc/AdaptationLayerTemplate.h Mon Jan 18 21:13:05 2010 +0200 @@ -25,9 +25,9 @@ #include "Layout.h" using namespace std; -#include -#include -#include +#include +#include +#include using namespace CdlCompilerToolkit; diff -r f58d6ec98e88 -r b700e12870ca aknlayoutcompiler/inc/Cdl2Lag.h --- a/aknlayoutcompiler/inc/Cdl2Lag.h Thu Dec 17 09:14:18 2009 +0200 +++ b/aknlayoutcompiler/inc/Cdl2Lag.h Mon Jan 18 21:13:05 2010 +0200 @@ -22,7 +22,7 @@ #include #include #include -#include +#include using namespace CdlCompilerToolkit; using namespace std; diff -r f58d6ec98e88 -r b700e12870ca aknlayoutcompiler/inc/CodeGenConsts.h --- a/aknlayoutcompiler/inc/CodeGenConsts.h Thu Dec 17 09:14:18 2009 +0200 +++ b/aknlayoutcompiler/inc/CodeGenConsts.h Mon Jan 18 21:13:05 2010 +0200 @@ -25,8 +25,8 @@ // includes const string KIncludeLayoutInstanceHeaderScalableDef("#include "); // directories -const string KDirEpocSysHeader("\\epoc32\\include\\"); -const string KDirDomainSysHeader("\\epoc32\\include\\platform\\mw\\"); +const string KDirEpocSysHeader("/epoc32/include/"); +const string KDirDomainSysHeader("/epoc32/include/platform/mw/"); // parameter namesy const string KParamNameBase("aIndex_"); diff -r f58d6ec98e88 -r b700e12870ca aknlayoutcompiler/inc/CoreParser.h --- a/aknlayoutcompiler/inc/CoreParser.h Thu Dec 17 09:14:18 2009 +0200 +++ b/aknlayoutcompiler/inc/CoreParser.h Mon Jan 18 21:13:05 2010 +0200 @@ -19,7 +19,6 @@ #include #include -#include class Parser; @@ -35,7 +34,7 @@ int iRuleId; int iStart; int iEnd; - std::deque iChildren; + std::vector iChildren; }; diff -r f58d6ec98e88 -r b700e12870ca aknlayoutcompiler/inc/FormulaParser.h --- a/aknlayoutcompiler/inc/FormulaParser.h Thu Dec 17 09:14:18 2009 +0200 +++ b/aknlayoutcompiler/inc/FormulaParser.h Mon Jan 18 21:13:05 2010 +0200 @@ -20,7 +20,7 @@ #include #include -#include "coreParser.h" +#include "CoreParser.h" using namespace std; enum TFormulaParserIds @@ -46,4 +46,4 @@ ParseResult ParseFormula(const string& aFormula); -#endif \ No newline at end of file +#endif diff -r f58d6ec98e88 -r b700e12870ca aknlayoutcompiler/inc/HtmlParse.h --- a/aknlayoutcompiler/inc/HtmlParse.h Thu Dec 17 09:14:18 2009 +0200 +++ b/aknlayoutcompiler/inc/HtmlParse.h Mon Jan 18 21:13:05 2010 +0200 @@ -24,7 +24,7 @@ #include #include #include -#include "layout.h" +#include "Layout.h" using namespace std; /** diff -r f58d6ec98e88 -r b700e12870ca aknlayoutcompiler/inc/Lay2Cdl.h --- a/aknlayoutcompiler/inc/Lay2Cdl.h Thu Dec 17 09:14:18 2009 +0200 +++ b/aknlayoutcompiler/inc/Lay2Cdl.h Mon Jan 18 21:13:05 2010 +0200 @@ -22,10 +22,11 @@ #include #include #include +#include #include "Layout.h" using namespace std; -#include +#include using namespace CdlCompilerToolkit; @@ -33,6 +34,7 @@ * LayoutToCdl * Generate a CDL interface for a layout */ + class LayoutToCdl { public: diff -r f58d6ec98e88 -r b700e12870ca aknlayoutcompiler/inc/Lay2LayPerf.h --- a/aknlayoutcompiler/inc/Lay2LayPerf.h Thu Dec 17 09:14:18 2009 +0200 +++ b/aknlayoutcompiler/inc/Lay2LayPerf.h Mon Jan 18 21:13:05 2010 +0200 @@ -25,7 +25,7 @@ #include "Layout.h" using namespace std; -#include +#include using namespace CdlCompilerToolkit; diff -r f58d6ec98e88 -r b700e12870ca aknlayoutcompiler/inc/LayCdl2Inst.h --- a/aknlayoutcompiler/inc/LayCdl2Inst.h Thu Dec 17 09:14:18 2009 +0200 +++ b/aknlayoutcompiler/inc/LayCdl2Inst.h Mon Jan 18 21:13:05 2010 +0200 @@ -25,9 +25,9 @@ #include "Layout.h" using namespace std; -#include -#include -#include +#include +#include +#include using namespace CdlCompilerToolkit; diff -r f58d6ec98e88 -r b700e12870ca aknlayoutcompiler/inc/LayCdl2InstO.h --- a/aknlayoutcompiler/inc/LayCdl2InstO.h Thu Dec 17 09:14:18 2009 +0200 +++ b/aknlayoutcompiler/inc/LayCdl2InstO.h Mon Jan 18 21:13:05 2010 +0200 @@ -25,13 +25,14 @@ #include "Layout.h" using namespace std; -#include -#include -#include +#include +#include +#include using namespace CdlCompilerToolkit; class CLayoutInstOpt; class CLayoutInstOptImpl; + typedef vector CLayoutInstOptImpls; /** diff -r f58d6ec98e88 -r b700e12870ca aknlayoutcompiler/inc/LayCdlCheck.h --- a/aknlayoutcompiler/inc/LayCdlCheck.h Thu Dec 17 09:14:18 2009 +0200 +++ b/aknlayoutcompiler/inc/LayCdlCheck.h Mon Jan 18 21:13:05 2010 +0200 @@ -25,9 +25,9 @@ #include "Layout.h" using namespace std; -#include -#include -#include +#include +#include +#include using namespace CdlCompilerToolkit; /** diff -r f58d6ec98e88 -r b700e12870ca aknlayoutcompiler/inc/LayScale.h --- a/aknlayoutcompiler/inc/LayScale.h Thu Dec 17 09:14:18 2009 +0200 +++ b/aknlayoutcompiler/inc/LayScale.h Mon Jan 18 21:13:05 2010 +0200 @@ -25,7 +25,7 @@ #include "Layout.h" using namespace std; -#include +#include using namespace CdlCompilerToolkit; diff -r f58d6ec98e88 -r b700e12870ca aknlayoutcompiler/inc/LayoutCompilerErr.h --- a/aknlayoutcompiler/inc/LayoutCompilerErr.h Thu Dec 17 09:14:18 2009 +0200 +++ b/aknlayoutcompiler/inc/LayoutCompilerErr.h Mon Jan 18 21:13:05 2010 +0200 @@ -22,7 +22,7 @@ #include #include -#include +#include using namespace CdlCompilerToolkit; using namespace std; diff -r f58d6ec98e88 -r b700e12870ca aknlayoutcompiler/inc/LayoutPack.h --- a/aknlayoutcompiler/inc/LayoutPack.h Thu Dec 17 09:14:18 2009 +0200 +++ b/aknlayoutcompiler/inc/LayoutPack.h Mon Jan 18 21:13:05 2010 +0200 @@ -24,9 +24,9 @@ #include using namespace std; -#include -#include -#include +#include +#include +#include using namespace CdlCompilerToolkit; /** diff -r f58d6ec98e88 -r b700e12870ca aknlayoutcompiler/inc/LayoutParse.h --- a/aknlayoutcompiler/inc/LayoutParse.h Thu Dec 17 09:14:18 2009 +0200 +++ b/aknlayoutcompiler/inc/LayoutParse.h Mon Jan 18 21:13:05 2010 +0200 @@ -26,6 +26,7 @@ #include #include "LayoutCompilerErr.h" #include "Layout.h" +#include using namespace std; diff -r f58d6ec98e88 -r b700e12870ca aknlayoutcompiler/inc/MLAttributesParse.h --- a/aknlayoutcompiler/inc/MLAttributesParse.h Thu Dec 17 09:14:18 2009 +0200 +++ b/aknlayoutcompiler/inc/MLAttributesParse.h Mon Jan 18 21:13:05 2010 +0200 @@ -48,7 +48,7 @@ class MSaxLayoutAttributesHandler { public: - typedef SAX::basic_Attributes TAttribs; // this is XML Attribs, not to be confused with layout attibutes! + typedef Arabica::SAX::Attributes TAttribs; // this is XML Attribs, not to be confused with layout attibutes! virtual MSaxLayoutAttributesHandler* HandleSax(const std::string& aElement, const TAttribs& aAttribs) { return this; }; virtual void HandleSaxEnd(const std::string& aElement) { }; }; @@ -95,18 +95,18 @@ /** * this is the main SAX parser implementation */ -class TLayoutAttributesSaxParser : private SAX::basic_DefaultHandler +class TLayoutAttributesSaxParser : private Arabica::SAX::DefaultHandler { private: typedef stack TSaxAttributesHandlerStack; - typedef SAX::basic_ErrorHandler::SAXParseExceptionT TException; + typedef Arabica::SAX::ErrorHandler::SAXParseExceptionT TException; public: TLayoutAttributesSaxParser(MSaxLayoutAttributesHandler* aHandler); void Parse(const std::string& aFileName); private: // from basic_DefaultHandler - void startElement(const std::string& namespaceURI, const std::string& localName, const std::string& qName, const SAX::basic_Attributes& atts); + void startElement(const std::string& namespaceURI, const std::string& localName, const std::string& qName, const Arabica::SAX::Attributes& atts); void endElement(const std::string& namespaceURI, const std::string& localName, const std::string& qName); void warning(const TException& aException); diff -r f58d6ec98e88 -r b700e12870ca aknlayoutcompiler/inc/MLCompCdl2InstO.h --- a/aknlayoutcompiler/inc/MLCompCdl2InstO.h Thu Dec 17 09:14:18 2009 +0200 +++ b/aknlayoutcompiler/inc/MLCompCdl2InstO.h Mon Jan 18 21:13:05 2010 +0200 @@ -26,9 +26,9 @@ #include "MLAttributes.h" using namespace std; -#include -#include -#include +#include +#include +#include using namespace CdlCompilerToolkit; // forward declares and typedefs diff -r f58d6ec98e88 -r b700e12870ca aknlayoutcompiler/inc/MLCompData.h --- a/aknlayoutcompiler/inc/MLCompData.h Thu Dec 17 09:14:18 2009 +0200 +++ b/aknlayoutcompiler/inc/MLCompData.h Mon Jan 18 21:13:05 2010 +0200 @@ -251,8 +251,6 @@ TMLCompDataLine* iLine; // not owned }; - - /** * TMLCompDataTable * A layout table diff -r f58d6ec98e88 -r b700e12870ca aknlayoutcompiler/inc/MLCompData2Cdl.h --- a/aknlayoutcompiler/inc/MLCompData2Cdl.h Thu Dec 17 09:14:18 2009 +0200 +++ b/aknlayoutcompiler/inc/MLCompData2Cdl.h Mon Jan 18 21:13:05 2010 +0200 @@ -25,7 +25,7 @@ #include "MLCompData.h" using namespace std; -#include +#include using namespace CdlCompilerToolkit; @@ -59,7 +59,7 @@ static string LineApiName(TMLCompDataLine& aLine); static string LineParamLimitsApiName(TMLCompDataLine& aLine); private: - static string MLCompDataToCdl::ReturnType(TMLCompDataLine& aLine); + static string ReturnType(TMLCompDataLine& aLine); static void ReplaceRemovedAPIs(CCdlTkInterface& aInterface, const TMLCompData& aLayout, bool aDeletesAllowed); static void CleanUpAPIComments(CCdlTkInterface& aInterface); static CCdlTkFunctionApi* ProcessFunctionApi(CCdlTkInterface& aInterface, string aReturnType, string aName, bool& aIsNew); diff -r f58d6ec98e88 -r b700e12870ca aknlayoutcompiler/inc/MLCompData2LayPerf.h --- a/aknlayoutcompiler/inc/MLCompData2LayPerf.h Thu Dec 17 09:14:18 2009 +0200 +++ b/aknlayoutcompiler/inc/MLCompData2LayPerf.h Mon Jan 18 21:13:05 2010 +0200 @@ -25,7 +25,7 @@ #include "MLCompData.h" using namespace std; -#include +#include using namespace CdlCompilerToolkit; diff -r f58d6ec98e88 -r b700e12870ca aknlayoutcompiler/inc/MLCompDataLayPerfWriter.h --- a/aknlayoutcompiler/inc/MLCompDataLayPerfWriter.h Thu Dec 17 09:14:18 2009 +0200 +++ b/aknlayoutcompiler/inc/MLCompDataLayPerfWriter.h Mon Jan 18 21:13:05 2010 +0200 @@ -27,7 +27,7 @@ class TMLCompDataLayPerfWriter; -#include +#include using namespace CdlCompilerToolkit; diff -r f58d6ec98e88 -r b700e12870ca aknlayoutcompiler/inc/MLCompDataParse.h --- a/aknlayoutcompiler/inc/MLCompDataParse.h Thu Dec 17 09:14:18 2009 +0200 +++ b/aknlayoutcompiler/inc/MLCompDataParse.h Mon Jan 18 21:13:05 2010 +0200 @@ -52,7 +52,7 @@ class MSaxLayoutHandler { public: - typedef SAX::basic_Attributes TAttribs; + typedef Arabica::SAX::Attributes TAttribs; virtual MSaxLayoutHandler* HandleSax(const std::string& aElement, const TAttribs& aAttribs) { return this; }; virtual void HandleSaxEnd(const std::string& aElement) { }; }; @@ -155,18 +155,18 @@ }; -class TLayoutSaxParser : private SAX::basic_DefaultHandler +class TLayoutSaxParser : private Arabica::SAX::DefaultHandler { private: typedef stack TSaxHandlerStack; - typedef SAX::basic_ErrorHandler::SAXParseExceptionT TException; + typedef Arabica::SAX::ErrorHandler::SAXParseExceptionT TException; public: TLayoutSaxParser(MSaxLayoutHandler* aHandler); void Parse(const std::string& aFileName); private: // from basic_DefaultHandler - void startElement(const std::string& namespaceURI, const std::string& localName, const std::string& qName, const SAX::basic_Attributes& atts); + void startElement(const std::string& namespaceURI, const std::string& localName, const std::string& qName, const Arabica::SAX::Attributes& atts); void endElement(const std::string& namespaceURI, const std::string& localName, const std::string& qName); void warning(const TException& aException); diff -r f58d6ec98e88 -r b700e12870ca aknlayoutcompiler/inc/MLEqCompDataParse.h --- a/aknlayoutcompiler/inc/MLEqCompDataParse.h Thu Dec 17 09:14:18 2009 +0200 +++ b/aknlayoutcompiler/inc/MLEqCompDataParse.h Mon Jan 18 21:13:05 2010 +0200 @@ -52,7 +52,7 @@ class MSaxLayoutEqHandler { public: - typedef SAX::basic_Attributes TAttribs; + typedef Arabica::SAX::Attributes TAttribs; virtual MSaxLayoutEqHandler* HandleSax(const std::string& aElement, const TAttribs& aAttribs) { return this; }; virtual void HandleSaxEnd(const std::string& aElement) { }; }; @@ -169,18 +169,18 @@ }; -class TEqLayoutSaxParser : private SAX::basic_DefaultHandler +class TEqLayoutSaxParser : private Arabica::SAX::DefaultHandler { private: typedef stack TSaxHandlerStack; - typedef SAX::basic_ErrorHandler::SAXParseExceptionT TException; + typedef Arabica::SAX::ErrorHandler::SAXParseExceptionT TException; public: TEqLayoutSaxParser(MSaxLayoutEqHandler* aHandler); void Parse(const std::string& aFileName); private: // from basic_DefaultHandler - void startElement(const std::string& namespaceURI, const std::string& localName, const std::string& qName, const SAX::basic_Attributes& atts); + void startElement(const std::string& namespaceURI, const std::string& localName, const std::string& qName, const Arabica::SAX::Attributes& atts); void endElement(const std::string& namespaceURI, const std::string& localName, const std::string& qName); void warning(const TException& aException); diff -r f58d6ec98e88 -r b700e12870ca aknlayoutcompiler/inc/MakeLayConvTest.h --- a/aknlayoutcompiler/inc/MakeLayConvTest.h Thu Dec 17 09:14:18 2009 +0200 +++ b/aknlayoutcompiler/inc/MakeLayConvTest.h Mon Jan 18 21:13:05 2010 +0200 @@ -25,9 +25,9 @@ #include "Layout.h" using namespace std; -#include -#include -#include +#include +#include +#include using namespace CdlCompilerToolkit; diff -r f58d6ec98e88 -r b700e12870ca aknlayoutcompiler/inc/MasterLayoutPack.h --- a/aknlayoutcompiler/inc/MasterLayoutPack.h Thu Dec 17 09:14:18 2009 +0200 +++ b/aknlayoutcompiler/inc/MasterLayoutPack.h Mon Jan 18 21:13:05 2010 +0200 @@ -24,9 +24,9 @@ #include using namespace std; -#include -#include -#include +#include +#include +#include using namespace CdlCompilerToolkit; /** diff -r f58d6ec98e88 -r b700e12870ca aknlayoutcompiler/inc/SaxErrorHandler.h --- a/aknlayoutcompiler/inc/SaxErrorHandler.h Thu Dec 17 09:14:18 2009 +0200 +++ b/aknlayoutcompiler/inc/SaxErrorHandler.h Mon Jan 18 21:13:05 2010 +0200 @@ -25,17 +25,18 @@ #ifndef __SAXERRORHANDLER_H_ #define __SAXERRORHANDLER_H_ -#include +#include +#include -class SAXErrorHandler : public SAX::ErrorHandler +class SAXErrorHandler : public Arabica::SAX::ErrorHandler { public: SAXErrorHandler() { } virtual ~SAXErrorHandler() { } public: // from SAX::ErrorHandler - virtual void warning(const SAX::SAXParseException&); - virtual void error(const SAX::SAXParseException&); - virtual void fatalError(const SAX::SAXParseException& exception); + virtual void warning(const Arabica::SAX::SAXParseException&); + virtual void error(const Arabica::SAX::SAXParseException&); + virtual void fatalError(const Arabica::SAX::SAXParseException&); }; -#endif // __SAXERRORHANDLER_H_ \ No newline at end of file +#endif // __SAXERRORHANDLER_H_ diff -r f58d6ec98e88 -r b700e12870ca aknlayoutcompiler/inc/UsefulDefinitions.h --- a/aknlayoutcompiler/inc/UsefulDefinitions.h Thu Dec 17 09:14:18 2009 +0200 +++ b/aknlayoutcompiler/inc/UsefulDefinitions.h Mon Jan 18 21:13:05 2010 +0200 @@ -22,5 +22,4 @@ #define ARRAY_LEN(x) (sizeof(x)/sizeof(*(x))) #define ARRAY_END(x) (x+(sizeof(x)/sizeof(*(x)))) - #endif // USEFULDEFINITIONS_H diff -r f58d6ec98e88 -r b700e12870ca aknlayoutcompiler/inc/WriterBase.h --- a/aknlayoutcompiler/inc/WriterBase.h Thu Dec 17 09:14:18 2009 +0200 +++ b/aknlayoutcompiler/inc/WriterBase.h Mon Jan 18 21:13:05 2010 +0200 @@ -18,7 +18,7 @@ #ifndef WRITERBASE_H #define WRITERBASE_H -#include "layout.h" +#include "Layout.h" /** * TWriterBase diff -r f58d6ec98e88 -r b700e12870ca aknlayoutcompiler/src/AdaptationLayerTemplate.cpp --- a/aknlayoutcompiler/src/AdaptationLayerTemplate.cpp Thu Dec 17 09:14:18 2009 +0200 +++ b/aknlayoutcompiler/src/AdaptationLayerTemplate.cpp Mon Jan 18 21:13:05 2010 +0200 @@ -90,7 +90,7 @@ AdaptationLayerTemplate::AdaptationLayerTemplate(TLayout& aLayout, CCdlTkInterface& aLayIface, CCdlTkInterface& aScaleIface, CCdlTkInstance& aInstance, string& aExisting) -: iLayout(aLayout), iLayIface(aLayIface), iScaleIface(aScaleIface), iInstance(aInstance), iExisting(aExisting) +: iLayIface(aLayIface), iScaleIface(aScaleIface), iLayout(aLayout), iInstance(aInstance), iExisting(aExisting) { } @@ -162,7 +162,7 @@ pair AdaptationLayerTemplate::GetApiMatch(const string& aName) { - int size = aName.size(); + //int size = aName.size(); CCdlTkApiList& apiList = iScaleIface.ApiList(); string bestMatch; int bestScore = 0; diff -r f58d6ec98e88 -r b700e12870ca aknlayoutcompiler/src/AknLayoutCompiler.cpp --- a/aknlayoutcompiler/src/AknLayoutCompiler.cpp Thu Dec 17 09:14:18 2009 +0200 +++ b/aknlayoutcompiler/src/AknLayoutCompiler.cpp Mon Jan 18 21:13:05 2010 +0200 @@ -28,7 +28,7 @@ #include #include #include -#include "extract.h" +#include "Extract.h" #include "LayoutCompilerErr.h" #include "Lay2Cdl.h" #include "Cdl2Lag.h" @@ -107,7 +107,7 @@ args.erase(args.begin()+1); } - string& modeName = CdlTkUtil::ToLower(args[1]); + string modeName = CdlTkUtil::ToLower(args[1]); if (modeName == "extract") { diff -r f58d6ec98e88 -r b700e12870ca aknlayoutcompiler/src/Cdl2Lag.cpp --- a/aknlayoutcompiler/src/Cdl2Lag.cpp Thu Dec 17 09:14:18 2009 +0200 +++ b/aknlayoutcompiler/src/Cdl2Lag.cpp Mon Jan 18 21:13:05 2010 +0200 @@ -49,7 +49,7 @@ CdlToLag process(lag, lagName); process.Start(); - for (int ii = 3; ii < args.size(); ii++) + for (unsigned int ii = 3; ii < args.size(); ii++) { string cdlName = args[ii]; CCdlTkCdlFileParser parser(cdlName); @@ -60,7 +60,7 @@ process.Finish(); lag.close(); - CdlTkUtil::ExportFile(temp, KDirEpocSysHeader+CdlTkUtil::StripPath(lagName)); + CdlTkUtil::ExportFile(temp, CdlTkUtil::CurrentDrive()+KDirEpocSysHeader+CdlTkUtil::StripPath(lagName)); return 0; } diff -r f58d6ec98e88 -r b700e12870ca aknlayoutcompiler/src/CoreParser.cpp --- a/aknlayoutcompiler/src/CoreParser.cpp Thu Dec 17 09:14:18 2009 +0200 +++ b/aknlayoutcompiler/src/CoreParser.cpp Mon Jan 18 21:13:05 2010 +0200 @@ -175,7 +175,7 @@ { Step& step = stack[i]; Step& parent = stack[step.iParent]; - parent.iResult.iChildren.push_front(step.iResult); + parent.iResult.iChildren.insert(0,step.iResult);//push_front if (parent.iResult.iEnd < step.iResult.iEnd) parent.iResult.iEnd = step.iResult.iEnd; } @@ -196,7 +196,7 @@ case EExact: { string match(iMatch); - int mLen = match.size(); + unsigned int mLen = match.size(); if (mLen + aPos > aString.size()) return EFail; else if (aString.substr(aPos, mLen) != match) @@ -208,7 +208,7 @@ case EEos: { - if (aPos != aString.size()) + if (static_cast( aPos ) != aString.size()) return EFail; else step.iResult.iEnd = aPos; @@ -319,7 +319,7 @@ if (res.iChildren.size()) { cout << "{ "; - for (int i=0; i +#include #include #include @@ -614,7 +614,7 @@ BuildLayoutLineTable(); CCdlTkFileCleanup temp(iName+".lag"); Output(iName+".cpp", iName+".lag", lay); - CdlTkUtil::ExportFile(temp, KDirEpocSysHeader+iShortName+".lag"); + CdlTkUtil::ExportFile(temp, CdlTkUtil::CurrentDrive()+KDirEpocSysHeader+iShortName+".lag"); } void TCppWriter::Output(const string& aCpp, const string& aLag, const string& aLayName) diff -r f58d6ec98e88 -r b700e12870ca aknlayoutcompiler/src/Extract.cpp --- a/aknlayoutcompiler/src/Extract.cpp Thu Dec 17 09:14:18 2009 +0200 +++ b/aknlayoutcompiler/src/Extract.cpp Mon Jan 18 21:13:05 2010 +0200 @@ -71,7 +71,7 @@ iDocName = args[2]; - int layoutIndex = 3; + unsigned int layoutIndex = 3; if (args[3][0] == '-') { if (args[3].size() < 3 || args[3][1] != 'o') diff -r f58d6ec98e88 -r b700e12870ca aknlayoutcompiler/src/FormulaParser.cpp --- a/aknlayoutcompiler/src/FormulaParser.cpp Thu Dec 17 09:14:18 2009 +0200 +++ b/aknlayoutcompiler/src/FormulaParser.cpp Mon Jan 18 21:13:05 2010 +0200 @@ -147,4 +147,4 @@ return formulaParser.Parse(aFormula); - } \ No newline at end of file + } diff -r f58d6ec98e88 -r b700e12870ca aknlayoutcompiler/src/FormulaTree.cpp --- a/aknlayoutcompiler/src/FormulaTree.cpp Thu Dec 17 09:14:18 2009 +0200 +++ b/aknlayoutcompiler/src/FormulaTree.cpp Mon Jan 18 21:13:05 2010 +0200 @@ -201,10 +201,10 @@ FormulaTreeNode::FormulaTreeNode(const FormulaTreeNode& aOther) : iSource(aOther.iSource), iStart(aOther.iStart), iLen(aOther.iLen), iType(aOther.iType) { - for (int i=0; i #include #include +#include using namespace std; @@ -33,7 +34,7 @@ string TrimWhiteSpace(const string& aString) { - int start = aString.find_first_not_of(WhiteSpace); + string::size_type start = aString.find_first_not_of(WhiteSpace); if (start == string::npos) return ""; else @@ -95,7 +96,7 @@ void THtmlParseLayoutTable::ExtractTitle(const string& aText) { iName = UnHtml(aText); - int pos = iName.find_first_not_of("1234567890.\t\r\n "); + string::size_type pos = iName.find_first_not_of("1234567890.\t\r\n "); if (pos == string::npos) return; iName = iName.substr(pos); @@ -209,7 +210,7 @@ int THtmlParseLayoutTable::GetVal(const string& aText, const string& aField) { - int pos = aText.find(aField+"="); + string::size_type pos = aText.find(aField+"="); if (pos == string::npos) return 0; string val = aText.substr(pos + aField.length() + 1); @@ -252,7 +253,7 @@ if (aText.length()==0) return aText; - int pos = aText.find_last_not_of(" ,"); + string::size_type pos = aText.find_last_not_of(" ,"); if (pos == string::npos) return ""; @@ -516,7 +517,7 @@ int lastSpace = -1; int lastNum = -1; - for (int i=0; i +#include #include #include #include diff -r f58d6ec98e88 -r b700e12870ca aknlayoutcompiler/src/Lay2LayPerf.cpp --- a/aknlayoutcompiler/src/Lay2LayPerf.cpp Thu Dec 17 09:14:18 2009 +0200 +++ b/aknlayoutcompiler/src/Lay2LayPerf.cpp Mon Jan 18 21:13:05 2010 +0200 @@ -23,7 +23,7 @@ #include "Lay2LayPerf.h" #include "LayoutParse.h" #include "LayoutCompilerErr.h" -#include +#include #include #include #include @@ -64,10 +64,10 @@ LayoutToLayPerf::LayoutToLayPerf(const string& aCdlName, TLayout& aSourceLayout, const string& aDestLayoutName) -: - iCdlName(aCdlName), + : iLayout(aSourceLayout), - iDestLayoutName(aDestLayoutName) + iDestLayoutName(aDestLayoutName), + iCdlName(aCdlName) { } diff -r f58d6ec98e88 -r b700e12870ca aknlayoutcompiler/src/LayCdl2Inst.cpp --- a/aknlayoutcompiler/src/LayCdl2Inst.cpp Thu Dec 17 09:14:18 2009 +0200 +++ b/aknlayoutcompiler/src/LayCdl2Inst.cpp Mon Jan 18 21:13:05 2010 +0200 @@ -92,7 +92,7 @@ LayoutAndCdlToCdlInstance process(*iface); TLayout* base = NULL; - for (int arg = 3; arg < args.size(); arg += 2) + for (unsigned int arg = 3; arg < args.size(); arg += 2) { string layoutName = args[arg]; string instName = args[arg+1]; @@ -369,7 +369,7 @@ CCdlTkImplementation& imp = FindImp(apiName); const CCdlTkFunctionApi& api = imp.Api().AsFunc(); - const CCdlTkApiParams& params = api.Params(); + //const CCdlTkApiParams& params = api.Params(); TLayoutLine& line = *aTable[aSubTable[0]]; CCdlTkImplementation& lineImp = FindImp(LayoutToCdl::LineApiName(line)); @@ -382,7 +382,7 @@ ptrType = lineApi.PointerType(); int valid = 0; - for (int ii=0; ii LayoutCdlInstanceOptArgsErr; @@ -368,7 +368,7 @@ { if (maxVal == 0) maxVal = values.size(); - else if (maxVal != values.size()) + else if (static_cast(maxVal) != values.size()) throw CdlTkAssert(string("param range mismatch ") + line.Name() + " " + param.Name()); cells |= nextCell; } @@ -464,11 +464,12 @@ // the data lookup table. These need to be turned into an array by adding declarations // and brackets to the first and last implementations. Extra support functions are also // added. -extern string KExtraCpp = "\ +extern string KExtraCpp; +string KExtraCpp = "\ #include \"aknlayout2decode.h\"\n\ namespace $INTERFACE_NS { extern const TUint8 KByteCodedData[]; }\n"; - -extern string KInitialCpp ="\ +extern string KInitialCpp; +string KInitialCpp ="\ extern const TUint16 KDataLookup[$INTERFACE_NS::E_TApiId_TableSize];\n\ const SImplData KImplData = { KDataLookup, $INTERFACE_NS::KByteCodedData };\n\ \n\ @@ -548,7 +549,8 @@ #include const int KScalableFontIdOffset(0x1000); -extern SIdToInt gIdToIntTable[] = +extern SIdToInt gIdToIntTable[]; +SIdToInt gIdToIntTable[] = { { ELayoutAlignLeft, "ELayoutAlignLeft" }, { ELayoutAlignRight, "ELayoutAlignRight" }, @@ -611,7 +613,7 @@ void CLayoutInstOpt::EncodeValue(vector& aBytes, string aValue) { - int pos; + string::size_type pos; TranslateValue(aValue); if (aValue == "") @@ -721,7 +723,7 @@ LayoutCdlInstanceOpt process(*iface); TLayout* base = NULL; - for (int arg = 3; arg < args.size(); arg += 2) + for (unsigned int arg = 3; arg < args.size(); arg += 2) { string layoutName = args[arg]; string instName = args[arg+1]; diff -r f58d6ec98e88 -r b700e12870ca aknlayoutcompiler/src/LayCdlCheck.cpp --- a/aknlayoutcompiler/src/LayCdlCheck.cpp Thu Dec 17 09:14:18 2009 +0200 +++ b/aknlayoutcompiler/src/LayCdlCheck.cpp Mon Jan 18 21:13:05 2010 +0200 @@ -25,7 +25,7 @@ #include "LayoutCompilerErr.h" #include "LayoutParse.h" #include "Lay2Cdl.h" -#include +#include using namespace std; using namespace CdlCompilerToolkit; @@ -58,7 +58,7 @@ auto_ptr xIface(new CCdlTkInterface); CCdlTkApiList& xApiList = xIface->ApiList(); - for (int arg = nextArg; arg < args.size(); arg++) + for (unsigned int arg = nextArg; arg < args.size(); arg++) { string fileName = args[arg]; if (fileName.size() < 4) diff -r f58d6ec98e88 -r b700e12870ca aknlayoutcompiler/src/LayPerfWriter.cpp --- a/aknlayoutcompiler/src/LayPerfWriter.cpp Thu Dec 17 09:14:18 2009 +0200 +++ b/aknlayoutcompiler/src/LayPerfWriter.cpp Mon Jan 18 21:13:05 2010 +0200 @@ -22,7 +22,7 @@ #include "Layout.h" // for constants #include "CodeGenConsts.h" -#include +#include #include #include @@ -96,7 +96,7 @@ out << "\n// Layout MACROs for LAF Table : "; out << iTable.Name() << endl; - for (int i=0; i +#include #include #include #include diff -r f58d6ec98e88 -r b700e12870ca aknlayoutcompiler/src/Layout.cpp --- a/aknlayoutcompiler/src/Layout.cpp Thu Dec 17 09:14:18 2009 +0200 +++ b/aknlayoutcompiler/src/Layout.cpp Mon Jan 18 21:13:05 2010 +0200 @@ -109,8 +109,8 @@ // TLayoutLine TLayoutLine::TLayoutLine( TLayoutTable* aTable, int aId ) -: iTable(aTable), - iId(aId), +: iId(aId), + iTable(aTable), iIsUnique(true), iIsMirroredHorizontally(false), iIsMergedIdentical(false) @@ -309,15 +309,15 @@ TLayoutTable::TLayoutTable(TLayout* aTables) -: iTables(aTables), iType(EUnknownTable), iParent(0), iFirstLineGlobalIndex(-1), iAppend(false), iNoSubTables(false) +: iType(EUnknownTable), iTables(aTables), iParent(0), iFirstLineGlobalIndex(-1), iAppend(false), iNoSubTables(false) { } TLayoutTable::TLayoutTable(TLayout* aTables, const TLayoutTable& aOther) -: iTables(aTables), iType(aOther.iType), iParent(0), - iFirstLineGlobalIndex(aOther.iFirstLineGlobalIndex), - iAppend(aOther.iAppend), iColumnNames(aOther.iColumnNames), iName(aOther.iName), - iParentName(aOther.iParentName), iNoSubTables(aOther.iNoSubTables) +: iColumnNames(aOther.iColumnNames), iType(aOther.iType), + iTables(aTables), iName(aOther.iName), iParent(0), + iParentName(aOther.iParentName), iFirstLineGlobalIndex(aOther.iFirstLineGlobalIndex), + iAppend(aOther.iAppend), iNoSubTables(aOther.iNoSubTables) { for (const_iterator it = aOther.begin(); it != aOther.end(); ++it) push_back(new TLayoutLine(this, **it)); @@ -386,7 +386,7 @@ } case TLayout::KMergeModeUnion: { - int index = 0; + unsigned int index = 0; for (; pNew != aTable.end(); ++pNew) { bool found = false; @@ -411,7 +411,7 @@ } push_back(*pNew); (*pNew)->iTable = this; - if ((*pNew)->iId != size()) + if ( static_cast( (*pNew)->iId ) != size()) iNoSubTables = true; (*pNew)->iId = size(); } diff -r f58d6ec98e88 -r b700e12870ca aknlayoutcompiler/src/LayoutConfig.cpp --- a/aknlayoutcompiler/src/LayoutConfig.cpp Thu Dec 17 09:14:18 2009 +0200 +++ b/aknlayoutcompiler/src/LayoutConfig.cpp Mon Jan 18 21:13:05 2010 +0200 @@ -24,7 +24,7 @@ using namespace std; -const string KBuildConfigFile("\\epoc32\\include\\oem\\bldvariant.hrh"); +const string KBuildConfigFile("/epoc32/include/oem/bldvariant.hrh"); const string KLayoutMacroStart("__LAYOUT"); typedef LayoutProcessArgsErr LayoutConfigArgsErr; diff -r f58d6ec98e88 -r b700e12870ca aknlayoutcompiler/src/LayoutPack.cpp --- a/aknlayoutcompiler/src/LayoutPack.cpp Thu Dec 17 09:14:18 2009 +0200 +++ b/aknlayoutcompiler/src/LayoutPack.cpp Mon Jan 18 21:13:05 2010 +0200 @@ -60,8 +60,11 @@ string& id = args[5]; for(CZoomLevelNames::iterator pZoomName = zoomLevelNames.begin(); pZoomName != zoomLevelNames.end(); ++pZoomName) + { + //string zoomName = CdlTkUtil::Replace("\r", "", pZoomName->second); + //zoomName = CdlTkUtil::Replace("\n", "", zoomName); Process(name, w, h, id, styleName, deliveryTypeName, priority, appUid, args.begin() + 6, args.end(), pZoomName->second); - + } return 0; } @@ -75,7 +78,7 @@ stream << " The contents of the package." << endl; stream << " If -z is specified, then instances for zoom factors" << endl; stream << " (in the form \"n,string\") appearing in the file will be generated, " << endl; - stream << " by replacing the keyword $ZOOM in the package definitions." << endl; + stream << " by replacing the keyword ZOOM in the package definitions." << endl; stream << " If -s is specified, then instances for the appropriate" << endl; stream << " screen style as found in WSINI.INI will be generated." << endl; stream << " If -d is specified then the delivery type will be appended to" << endl; @@ -100,12 +103,12 @@ vector::const_iterator aEnd, const string& aZoomName) { - CCdlTkCdlFileParser parser(KDirDomainSysHeader+KLayoutPackCdlFile); + CCdlTkCdlFileParser parser(CdlTkUtil::CurrentDrive()+KDirDomainSysHeader+KLayoutPackCdlFile); auto_ptr iface(parser.LoadAndParse(true)); CCdlTkPackage pkg(*iface); pkg.TemplateAllImplementations(); - string zoomName = CdlTkUtil::Replace("$ZOOM", aZoomName, aName); + string zoomName = CdlTkUtil::Replace("ZOOM", aZoomName, aName); string zoomIdName = "EAknUiZoom" + aZoomName; string styleHash = Hash(aStyleName); string priority = CdlTkUtil::IntToString(CdlTkUtil::ParseInt(aPriority)); @@ -145,12 +148,12 @@ throw LayoutPackageArgsErr(); const string& inst = *aBegin; - string zoomContent = CdlTkUtil::Replace("$ZOOM", aZoomName, inst); + string zoomContent = CdlTkUtil::Replace("ZOOM", aZoomName, inst); pkg.AddExternalContent(zoomContent, dir, dll); } else { - string zoomContent = CdlTkUtil::Replace("$ZOOM", aZoomName, arg); + string zoomContent = CdlTkUtil::Replace("ZOOM", aZoomName, arg); pkg.AddLocalContent(zoomContent); cout << zoomContent << endl; } diff -r f58d6ec98e88 -r b700e12870ca aknlayoutcompiler/src/LayoutParse.cpp --- a/aknlayoutcompiler/src/LayoutParse.cpp Thu Dec 17 09:14:18 2009 +0200 +++ b/aknlayoutcompiler/src/LayoutParse.cpp Mon Jan 18 21:13:05 2010 +0200 @@ -246,11 +246,11 @@ } layout->iName = layName; - int pos=0; + string::size_type pos=0; bool first = true; while (pos != string::npos) { - int next = layName.find('+', pos); + string::size_type next = layName.find('+', pos); string name; if (next == string::npos) { diff -r f58d6ec98e88 -r b700e12870ca aknlayoutcompiler/src/LayoutWriter.cpp --- a/aknlayoutcompiler/src/LayoutWriter.cpp Thu Dec 17 09:14:18 2009 +0200 +++ b/aknlayoutcompiler/src/LayoutWriter.cpp Mon Jan 18 21:13:05 2010 +0200 @@ -66,7 +66,7 @@ if (iTable.iAppend) out << "\t+" << endl; - for (int i=0; i0) out << "," << endl; @@ -126,7 +126,7 @@ if (iTable.iAppend) out << "\t+" << endl; - for (int i=0; i0) out << "," << endl; diff -r f58d6ec98e88 -r b700e12870ca aknlayoutcompiler/src/MLAttributesParse.cpp --- a/aknlayoutcompiler/src/MLAttributesParse.cpp Thu Dec 17 09:14:18 2009 +0200 +++ b/aknlayoutcompiler/src/MLAttributesParse.cpp Mon Jan 18 21:13:05 2010 +0200 @@ -25,7 +25,7 @@ #include "MLAttributesParse.h" #include "MLCompDataParse.h" // for converting zoom strings -#include // for logical font ids +#include // for logical font ids #include #include @@ -140,7 +140,7 @@ auto_ptr TMLAttributesParse::Parse(const string& aLayName) { auto_ptr layout(new TMLAttributesParse); - int pos=0; + string layName = aLayName; if (layName.size() >= 2 && layName.substr(0,2) == "-m") @@ -210,15 +210,15 @@ void TLayoutAttributesSaxParser::Parse(const std::string& aFileName) { - SAX::basic_InputSource is(aFileName); - SAX::XMLReader parser; + Arabica::SAX::InputSource is(aFileName); + Arabica::SAX::XMLReader parser; parser.setContentHandler(*this); parser.setErrorHandler(*this); parser.parse(is); } void TLayoutAttributesSaxParser::startElement(const std::string& /*namespaceURI*/, const std::string& localName, - const std::string& /*qName*/, const SAX::basic_Attributes& atts) + const std::string& /*qName*/, const Arabica::SAX::Attributes& atts) { MSaxLayoutAttributesHandler* handler = iStack.top(); if (!handler) diff -r f58d6ec98e88 -r b700e12870ca aknlayoutcompiler/src/MLCompCdl2InstO.cpp --- a/aknlayoutcompiler/src/MLCompCdl2InstO.cpp Thu Dec 17 09:14:18 2009 +0200 +++ b/aknlayoutcompiler/src/MLCompCdl2InstO.cpp Mon Jan 18 21:13:05 2010 +0200 @@ -35,7 +35,7 @@ #include "CodeGenConsts.h" #include "UsefulDefinitions.h" -#include +#include #include #include @@ -67,7 +67,7 @@ const string KTheWordBlank("blank"); const string KParentRelativeMarker("Pp"); const string KCellNameJustification("J"); -const string KCompDataFileNameSuffix("compData"); +const string KCompDataFileNameSuffix("compdata"); const string KAttributesFileNameSuffix("attributes"); // this is the addressable area for each instance, as the lookup table is 16bit @@ -101,10 +101,11 @@ SCompDataImplFunc(TFuncType aType, string aDefn, string aPtrRef, CCdlTkApiParams& aParams) : - iType(aType), + iType(aType), + iParams(aParams), iDefn(aDefn), - iPtrRef(aPtrRef), - iParams(aParams) + iPtrRef(aPtrRef) + { } @@ -122,10 +123,10 @@ { if(iType != aType) return false; - int size = iParams.size(); + unsigned int size = iParams.size(); if(size != aParams.size()) return false; - for(int ii = 0; ii < size; ii++) + for(unsigned int ii = 0; ii < size; ii++) { CCdlTkApiParam& thisParam = iParams[ii]; CCdlTkApiParam& otherParam = aParams[ii]; @@ -162,7 +163,7 @@ * This is a collection of all SCompDataImplFunc objects that a layout instance needs, initialised * so that there are up to four integer parameters per API type. */ -CAllCompDataFuncs gTheFuncs; +CAllCompDataFuncs gTheCompDataFuncs; // // CAllCompDataFuncs @@ -210,9 +211,9 @@ for(set< Seq >::iterator pPattern = subPatterns.begin(); pPattern != subPatterns.end(); ++pPattern) { CCdlTkApiParams params; - for(Seq::iterator pParam = pPattern->begin(); pParam != pPattern->end(); ++pParam) + for(Seq::const_iterator pParam = pPattern->begin(); pParam != pPattern->end(); ++pParam) { - int& param = (*pParam); + int param = (*pParam); string name = paramNames[param]; params.push_back(CCdlTkApiParam(KTypeInt, name)); } @@ -374,8 +375,8 @@ TMLCompDataTable::TMLCompDataSubTable* aSubTable, CCdlTkImplementation* aImpl) : + CMLCompDataInstOptImpl(aImpl), iTable(aTable), - CMLCompDataInstOptImpl(aImpl), iSubTable(aSubTable) { } @@ -481,9 +482,9 @@ iInstances(aInstances), iLayout(aLayout), iName(aInstName), - iZoomName(aZoomName), + iZoomName(aZoomName), + iInterface(iInstances.Interface()), iZoomLevel(aZoomLevel), - iInterface(iInstances.Interface()), iAllParams(aAllParams), iBaseOffset(0) { @@ -537,7 +538,7 @@ delete iInstance; for (CMLCompDataInstOptImpls::iterator pImpl = iImpls.begin(); pImpl != iImpls.end(); ++pImpl) delete *pImpl; - for (pImpl = iTableImpls.begin(); pImpl != iTableImpls.end(); ++pImpl) + for (CMLCompDataInstOptImpls::iterator pImpl = iTableImpls.begin(); pImpl != iTableImpls.end(); ++pImpl) delete *pImpl; } @@ -550,7 +551,7 @@ ProcessLines(**pTab); } - for (pTab = iLayout->begin(); pTab != iLayout->end(); ++pTab) + for (TMLCompData::iterator pTab = iLayout->begin(); pTab != iLayout->end(); ++pTab) { ProcessTables(**pTab); } @@ -561,7 +562,7 @@ // with the correct base offset, the definitions can be updated UpdateLineImpls(); - for (pTab = iLayout->begin(); pTab != iLayout->end(); ++pTab) + for (TMLCompData::iterator pTab = iLayout->begin(); pTab != iLayout->end(); ++pTab) { // now that the rest of the data is stable, we can add the tables at the end UpdateTables(**pTab); @@ -709,7 +710,7 @@ if(!CheckByteCodeIndexInRange(aImpl.iByteCodeIndex)) throw GeneralErr(aImpl.iName + " in interface " + iInterface.FileName()); // the base offset has been updated, so all definitions must be refreshed - int adjustedIndex = aImpl.iByteCodeIndex - iBaseOffset; + //int adjustedIndex = aImpl.iByteCodeIndex - iBaseOffset; aImpl.iImpl->SetDefinition(DefinitionString(aImpl.iByteCodeIndex, aImpl.iName)); UpdateParamLimits(aImpl.iName); } @@ -860,7 +861,7 @@ // calculate the number of values bool needsHeader = line.NeedsOptions() || line.NeedsCols() || line.NeedsRows(); unsigned int nextCellFlag = 1; // bit flag for the next cell, note it can get bigger than a char - for (cell = 0; cell < aOutputOrder.size(); cell++) + for (unsigned int cell = 0; cell < aOutputOrder.size(); cell++) { string cellName = aOutputOrder[cell]; TMLCompDataValues::TCompDataCellType type = TMLCompDataValues::Type(cellName); @@ -910,9 +911,9 @@ bool optimizeVarieties = true; bool optimizeCalcs = true; - int numCalcs = 0; + unsigned int numCalcs = 0; int* largestParamLimitPtr = max_element(aParamLimitVarieties.begin(), aParamLimitVarieties.end()); - int largestParamLimit = largestParamLimitPtr != aParamLimitVarieties.end() ? *largestParamLimitPtr : 0; + unsigned int largestParamLimit = largestParamLimitPtr != aParamLimitVarieties.end() ? *largestParamLimitPtr : 0; // in the case of there being no calcs at all, we don't want to be optimizing, // in order to avoid wasted flags. @@ -932,7 +933,7 @@ numCalcs = calcs->size(); string value; vector foundCalcs; - int paramLimit = aParamLimitVarieties[varietyIndex]; + unsigned int paramLimit = aParamLimitVarieties[varietyIndex]; if(numCalcs == 0) { if(varietyIndex == 0) @@ -943,7 +944,7 @@ } else { - for(int index = 0; index < numCalcs; index++) + for(unsigned int index = 0; index < numCalcs; index++) { bool needToCheckIndexValidity = !isColRow || (index < paramLimit); value = (*calcs)[index]; @@ -994,7 +995,7 @@ // but if we're optimizing the calcs, then we don't want to expand them after all if(!optimizeCalcs) { - int optimal = optimizedValues.size(); + unsigned int optimal = optimizedValues.size(); string value = optimal > 0 ? optimizedValues[optimal-1] : string(); for(; optimal < largestParamLimit; optimal++) { @@ -1195,10 +1196,10 @@ return func; } - int count = gTheFuncs.size(); + int count = gTheCompDataFuncs.size(); for (int ii=0; iiIsSimilar(aType, aParams)) { iFuncs.push_back(func); @@ -1207,7 +1208,7 @@ } throw NotFoundErr("implementation function"); - return gTheFuncs[0]; + return gTheCompDataFuncs[0]; } void CMLCompDataInstOpt::SetGenericAPI(SCompDataImplFunc::TFuncType aType, const string& aName) @@ -1411,13 +1412,17 @@ nParams--; // don't count the aLineIndex param SCompDataImplFunc::TFuncType type = SCompDataImplFunc::EWindowTable; TMLCompDataLine::TComponentType subTableType = aTable[aSub[0]]->iType; - switch(subTableType) +// switch(subTableType) +// { +// case TMLCompDataLine::ETextComponent: +// { +// type = SCompDataImplFunc::ETextTable; +// break; +// } +// } + if ( TMLCompDataLine::ETextComponent == subTableType ) { - case TMLCompDataLine::ETextComponent: - { - type = SCompDataImplFunc::ETextTable; - break; - } + type = SCompDataImplFunc::ETextTable; } CCdlTkFunctionApi& api = const_cast(impl.Api().AsFunc()); CCdlTkApiParams& params = api.Params(); @@ -1427,7 +1432,7 @@ iAllParams || aSub.iNeedsOption, iAllParams || aSub.iNeedsCol, iAllParams || aSub.iNeedsRow); - SCompDataImplFunc& func = AddImplFunc(type, params); + AddImplFunc(type, params); } void CMLCompDataInstOpt::AddParamLimits(TMLCompDataLine& aLine, bool aNeedsOptions) @@ -1519,7 +1524,7 @@ void CMLCompDataInstOpt::EncodeValue(vector& aBytes, string aValue) { - int pos = 0; + string::size_type pos = 0; TranslateValue(aValue); if (aValue == "") { @@ -1610,7 +1615,7 @@ void MLCompDataCdlInstanceOpt::ProcessSeparators(vector& args, vector& aSeparators) { - for(int arg = 3; arg < args.size(); arg++) + for(unsigned int arg = 3; arg < args.size(); arg++) { if(args[arg] == "-a") aSeparators.push_back(arg); @@ -1623,7 +1628,7 @@ // check that the distance between each separator is not a multiple of 2 // i.e. counting the steps between aSeparators ( sep -> xml -> inst -> sep) is 3 steps // i.e. counting the steps between aSeparators ( sep -> xml -> inst -> xml -> inst -> sep) is 5 steps - for(int sep = 0; sep < aSeparators.size() - 1; sep++) + for(unsigned int sep = 0; sep < aSeparators.size() - 1; sep++) { int delta = aSeparators[sep+1] - aSeparators[sep]; if (delta%2 == 0) @@ -1659,11 +1664,9 @@ string layoutName = aArgs[arg]; string instName = aArgs[arg+1]; string attribsName = CdlTkUtil::Replace(KCompDataFileNameSuffix, KAttributesFileNameSuffix, layoutName); - auto_ptr layoutParse = TMLCompDataParseLayout::Parse(layoutName); auto_ptr layout(layoutParse.get()); layoutParse.release(); - auto_ptr attribsParse = TMLAttributesParse::Parse(attribsName); auto_ptr attribs(attribsParse.get()); attribsParse.release(); @@ -1682,10 +1685,11 @@ { bool isMirrored = (count != 0); // first iterate through the layouts, we will generate one instance per layout - for(int instIndex = 0; instIndex < aInstances.size(); instIndex++) + for(unsigned int instIndex = 0; instIndex < aInstances.size(); instIndex++) { const InstStruct& instStruct = aInstances[instIndex]; - string targetInstName = instStruct.iInstName; + string targetInstName = CdlTkUtil::Replace("\r","",instStruct.iInstName); + targetInstName = CdlTkUtil::Replace("\n","",targetInstName); TMLCompData& targetLayout = *(instStruct.iInst); TMLAttributes& targetAttribs = *(instStruct.iAttribs); @@ -1764,7 +1768,7 @@ throw MLCompDataCdlInstanceOptArgsErr(); // check for optional flags - int arg = 2; + int arg = 2; bool allParams = false; if (args[arg] == "-allparams") { @@ -1791,7 +1795,7 @@ // the separators divide the layout instances that are aggregated together vector separators; ProcessSeparators(args, separators); - for(int sep = 0; sep < separators.size() - 1; sep++) + for(unsigned int sep = 0; sep < separators.size() - 1; sep++) { if(!CheckForUsedInstances(instUsedList, zoomLevelNames, args, separators, sep)) continue; @@ -1807,7 +1811,6 @@ pMergedLayout = mergedLayouts.erase(pMergedLayout); } } - process.Process(); process.WriteInstances(); return 0; @@ -1878,7 +1881,6 @@ continue; CMLCompDataInstOpt* firstInstOpt = compDatas[0]; cout << "processing instances for zoom level: " << firstInstOpt->ZoomName() << endl; - string firstInstName = firstInstOpt->Name(); for (CCompDatas::iterator pLayout = compDatas.begin(); pLayout != compDatas.end(); ++pLayout) (*pLayout)->Process(firstInstName); @@ -1887,8 +1889,7 @@ } void MLCompDataCdlInstanceOpt::WriteInstances() - { - bool found = false; + { bool found = false; for(CCompDataZoomLevelDatas::iterator pZoomLevel = iZoomLevelDatas.begin(); pZoomLevel != iZoomLevelDatas.end(); ++pZoomLevel) { CCompDatas& compDatas = pZoomLevel->second; diff -r f58d6ec98e88 -r b700e12870ca aknlayoutcompiler/src/MLCompData.cpp --- a/aknlayoutcompiler/src/MLCompData.cpp Thu Dec 17 09:14:18 2009 +0200 +++ b/aknlayoutcompiler/src/MLCompData.cpp Mon Jan 18 21:13:05 2010 +0200 @@ -26,7 +26,7 @@ #include "CodeGenConsts.h" #include "UsefulDefinitions.h" -#include "Akndef.hrh" +#include #include #include @@ -191,7 +191,7 @@ int thisSize = size(); int numVarieties = iLine->MaxVariety() + 1; // get zero based index int maximum = max(numVarieties, thisSize); - int maxMulti; + unsigned int maxMulti; switch(TMLCompDataValues::Type(aCellName)) { case ECellTypeCol: @@ -294,21 +294,21 @@ TMLCompDataLine::TMLCompDataLine() : iId(0), - iIsUnique(true), - iIsMirroredHorizontally(false), + iName(KCompDataUnknown), iType(EUnknownComponent), - iName(KCompDataUnknown), iDrawingOrder(-1), iMaxVariety(0), iParentTable(0), iParentInfo(0), iAttributeInfo(0), - iNumCols(1), - iNumRows(1), + iIsUnique(true), + iGlobalIndex(0), + iIsMirroredHorizontally(false), iNeedsOptions(false), iNeedsCols(false), iNeedsRows(false), - iGlobalIndex(0) + iNumCols(1), + iNumRows(1) { } @@ -445,6 +445,7 @@ TMLCompData& data = *(iParentTable->iTables); TMLAttributes& attributes = *(data.iAttributes); int attribId = attributes.iNames[aAttribName]; + if(attribId == 0) throw GeneralErr(string("Attribute name not found: ") + aAttribName); // find out from attribute info which attribute set we need @@ -850,24 +851,27 @@ TMLCompDataTable::TMLCompDataTable(TMLCompData* aTables) : + iId(0), iTables(aTables), - iParentLine(NULL), - iFirstLineGlobalIndex(-1), + iParentLine(NULL), + iNeedsP(false), + iNeedsIndex(false), iAppend(false), - iId(0), - iNeedsP(false), - iNeedsIndex(false) + iFirstLineGlobalIndex(-1) { } TMLCompDataTable::TMLCompDataTable(TMLCompData* aTables, const TMLCompDataTable& aOther) : - iTables(aTables), + iId(aOther.iId), + iName(aOther.iName), + iTables(aTables), + iColumnNames(aOther.iColumnNames), iParentLine(NULL), - iFirstLineGlobalIndex(aOther.iFirstLineGlobalIndex), - iAppend(aOther.iAppend), iColumnNames(aOther.iColumnNames), iName(aOther.iName), iParentName(aOther.iParentName), - iId(aOther.iId) + iAppend(aOther.iAppend), + iFirstLineGlobalIndex(aOther.iFirstLineGlobalIndex) + { for (const_iterator pLine = aOther.begin(); pLine != aOther.end(); ++pLine) push_back(new TMLCompDataLine(**pLine)); @@ -912,7 +916,7 @@ string subTableName = MLCompDataToCdl::SubTableApiName(sub); string subTableLimitsName = MLCompDataToCdl::SubTableLimitsApiName(sub); string paramLimitsName = MLCompDataToCdl::SubTableParamLimtsApiName(sub); - TMLCompDataLine& line = *((*this)[0]); + // first check the lines for a direct match // then try the param limits instead if (subTableName == aName || @@ -1064,13 +1068,11 @@ const string KPaneColumnNames[] = {"Item", "C", "l", "t", "r", "b", "W", "H", "Remarks"}; -const string KGraphicColumnNames[] = {"Item", "C", "l", "t", "r", "b", "W", "H", "Remarks"}; -const string KTextColumnNames[] = {"Font", "C", "l", "r", "t", "b", "W", "H", "J", "Remarks"}; void TMLCompDataTable::SetDefaultColumnNames() { iColumnNames.clear(); - iColumnNames.insert(iColumnNames.end(), KPaneColumnNames, ARRAY_END(KTextColumnNames)); // superset + iColumnNames.insert(iColumnNames.end(), KPaneColumnNames, ARRAY_END(KPaneColumnNames)); } TMLCompDataTable::TMLCompDataSubTable::TMLCompDataSubTable() @@ -1232,7 +1234,7 @@ TMLCompDataParentInfoSelector& selector = (parentInfo.begin())->second; // we ignore the varieties for now parentId = selector.iParentId; TMLCompDataTable* parentTable = FindTable(parentId); - TMLCompDataLine* parentLine = iComponents[parentId]; + if(parentTable) { line.iParentTable = parentTable; diff -r f58d6ec98e88 -r b700e12870ca aknlayoutcompiler/src/MLCompData2Cdl.cpp --- a/aknlayoutcompiler/src/MLCompData2Cdl.cpp Thu Dec 17 09:14:18 2009 +0200 +++ b/aknlayoutcompiler/src/MLCompData2Cdl.cpp Mon Jan 18 21:13:05 2010 +0200 @@ -23,7 +23,7 @@ #include "MLCompDataParse.h" #include "MLAttributesParse.h" #include "LayoutCompilerErr.h" -#include +#include #include #include #include @@ -39,7 +39,7 @@ const int KGeneratedInterfaceMajorVer = 1; const int KGeneratedInterfaceMinorVer = 0; -const string KCompDataFileNameSuffix("compData"); +const string KCompDataFileNameSuffix("compdata"); const string KAttributesFileNameSuffix("attributes"); @@ -57,7 +57,7 @@ { iInterfaceNamesUsed.clear(); - int numExpectedArgs = 4; + unsigned int numExpectedArgs = 4; if(args.size() < numExpectedArgs) throw MLCompDataToCdlArgsErr(); @@ -151,7 +151,7 @@ arg = numExpectedArgs-2; // so that we get a list of processed files to output to the comment - for(ii = 0; ii < numLayouts; ii++) + for(int ii = 0; ii < numLayouts; ii++) comment << args[arg++] << ", "; comment << endl; comment << "// which was generated with timestamp " << mergedLayout->iTimestamp << endl; @@ -347,7 +347,7 @@ aInterface.Header().SetVersion(CCdlTkInterfaceHeader::CVersion(KGeneratedInterfaceMajorVer, KGeneratedInterfaceMinorVer)); CCdlTkCpp& cpp = aInterface.Cpp(); - int size = cpp.size(); +// int size = cpp.size(); if(!find(cpp.begin(), cpp.end(), KIncludeLayoutInstanceHeaderScalableDef)) cpp.push_back(KIncludeLayoutInstanceHeaderScalableDef); } diff -r f58d6ec98e88 -r b700e12870ca aknlayoutcompiler/src/MLCompData2LayPerf.cpp --- a/aknlayoutcompiler/src/MLCompData2LayPerf.cpp Thu Dec 17 09:14:18 2009 +0200 +++ b/aknlayoutcompiler/src/MLCompData2LayPerf.cpp Mon Jan 18 21:13:05 2010 +0200 @@ -23,7 +23,7 @@ // disable "decorated name length exceeded, name was truncated" #pragma warning (disable:4503) -#include +#include #include #include #include @@ -111,10 +111,10 @@ MLCompDataToLayPerf::MLCompDataToLayPerf(const string& aCdlName, CCdlTkInterface& aInterface, TMLCompData& aSourceLayout, const string& aDestLayoutName) : + iLayout(aSourceLayout), + iDestLayoutName(aDestLayoutName), iCdlName(aCdlName), - iInterface(aInterface), - iLayout(aSourceLayout), - iDestLayoutName(aDestLayoutName) + iInterface(aInterface) { } diff -r f58d6ec98e88 -r b700e12870ca aknlayoutcompiler/src/MLCompDataLayPerfWriter.cpp --- a/aknlayoutcompiler/src/MLCompDataLayPerfWriter.cpp Thu Dec 17 09:14:18 2009 +0200 +++ b/aknlayoutcompiler/src/MLCompDataLayPerfWriter.cpp Mon Jan 18 21:13:05 2010 +0200 @@ -22,8 +22,8 @@ #include "LayoutCompilerErr.h" #include "CodeGenConsts.h" -#include -#include +#include +#include #include #include @@ -88,7 +88,7 @@ out << "\n// Layout MACROs for Layout Table : "; out << iTable.Name() << endl; - for (int i=0; i(aLayout, aName) + TMLWriterBase(aLayout, aName), + iInterface(aInterface) { } @@ -201,7 +201,7 @@ string ifName(iInterface.Header().Name()); out << "// function implementations: " << endl; - int tableId = 0; + unsigned int tableId = 0; for (TMLCompData::iterator pTab = iLayout.begin(); pTab != iLayout.end(); ++pTab) { TMLCompDataLayPerfTableWriter writer(this, **pTab, ifName, tableId++); diff -r f58d6ec98e88 -r b700e12870ca aknlayoutcompiler/src/MLCompDataParse.cpp --- a/aknlayoutcompiler/src/MLCompDataParse.cpp Thu Dec 17 09:14:18 2009 +0200 +++ b/aknlayoutcompiler/src/MLCompDataParse.cpp Mon Jan 18 21:13:05 2010 +0200 @@ -23,7 +23,7 @@ #include "MLCompDataParse.h" -#include +#include #include #include @@ -489,7 +489,7 @@ string maxVarietyStr = aAttribs.getValue(KCompDataParseNodeComponentAttributeMaxVariety); if(!maxVarietyStr.empty()) // screen doesn't have maxVariety for some reason { - int maxVariety = CdlTkUtil::ParseInt(maxVarietyStr) - 2; + //int maxVariety = CdlTkUtil::ParseInt(maxVarietyStr) - 2; // we ignore the maxVariety for now, as it will be calculated by parsing the values } } @@ -694,7 +694,7 @@ auto_ptr layout(new TMLCompDataParseLayout); int pos=0; string layName = aLayName; - int next = layName.find('+', pos); + string::size_type next = layName.find('+', pos); if (next != string::npos) { throw GeneralErr(layName + " TMLCompDataParseLayout::Parse() - doesn't support multiple files"); @@ -724,15 +724,15 @@ void TLayoutSaxParser::Parse(const std::string& aFileName) { - SAX::basic_InputSource is(aFileName); - SAX::XMLReader parser; + Arabica::SAX::InputSource is(aFileName); + Arabica::SAX::XMLReader parser; parser.setContentHandler(*this); parser.setErrorHandler(*this); parser.parse(is); } void TLayoutSaxParser::startElement(const std::string& /*namespaceURI*/, const std::string& localName, - const std::string& /*qName*/, const SAX::basic_Attributes& atts) + const std::string& /*qName*/, const Arabica::SAX::Attributes& atts) { MSaxLayoutHandler* handler = iStack.top(); if (!handler) diff -r f58d6ec98e88 -r b700e12870ca aknlayoutcompiler/src/MLEqCompData.cpp --- a/aknlayoutcompiler/src/MLEqCompData.cpp Thu Dec 17 09:14:18 2009 +0200 +++ b/aknlayoutcompiler/src/MLEqCompData.cpp Mon Jan 18 21:13:05 2010 +0200 @@ -27,7 +27,7 @@ #include "CodeGenConsts.h" #include "UsefulDefinitions.h" -#include "Akndef.hrh" +#include #include #include @@ -106,7 +106,7 @@ iZoomId(aOther.iZoomId), iFormulaTree(aOther.iFormulaTree) { - int x = 0; + } const TMLEqCompDataFormula& TMLEqCompDataFormula::operator=(const TMLEqCompDataFormula& aOther) @@ -322,17 +322,18 @@ TMLEqCompDataLine::TMLEqCompDataLine() : iId(0), - iIsUnique(true), - iIsMirroredHorizontally(false), + iName(KEqCompDataUnknown), iType(EUnknownComponent), - iName(KEqCompDataUnknown), iDrawingOrder(-1), iParentTable(0), iParentInfo(0), + iIsUnique(true), + iGlobalIndex(0), + iIsMirroredHorizontally(false), // iAttributeInfo(0), iNumCols(1), - iNumRows(1), - iGlobalIndex(0) + iNumRows(1) + { } @@ -738,18 +739,18 @@ TMLEqCompDataTable::TMLEqCompDataTable(TMLEqCompData* aTables) : + iId(0), iTables(aTables), - iParentLine(NULL), - iId(0) + iParentLine(NULL) { } TMLEqCompDataTable::TMLEqCompDataTable(TMLEqCompData* aTables, const TMLEqCompDataTable& aOther) : + iId(aOther.iId), iTables(aTables), iParentLine(NULL), - iParentName(aOther.iParentName), - iId(aOther.iId) + iParentName(aOther.iParentName) { for (const_iterator pOptionSet = aOther.begin(); pOptionSet != aOther.end(); ++pOptionSet) { @@ -1021,7 +1022,6 @@ if(parentId != 0) { TMLEqCompDataTable* parentTable = FindTable(parentId); - TMLEqCompDataLine* parentLine = iComponents[parentId]; if(parentTable) { line.iParentTable = parentTable; diff -r f58d6ec98e88 -r b700e12870ca aknlayoutcompiler/src/MLEqCompData2DHuiML.cpp --- a/aknlayoutcompiler/src/MLEqCompData2DHuiML.cpp Thu Dec 17 09:14:18 2009 +0200 +++ b/aknlayoutcompiler/src/MLEqCompData2DHuiML.cpp Mon Jan 18 21:13:05 2010 +0200 @@ -24,7 +24,7 @@ #include "LayoutCompilerErr.h" #include "FormulaTree.h" -#include +#include #include #include @@ -188,7 +188,7 @@ cout << "writing dhuiml file " << dhuimlName << endl; ofstream dhuiml(dhuimlName.c_str()); - int KIndent = 4; + //int KIndent = 4; TEqLayoutSaxWriter saxWriter(dhuiml); saxWriter.StartDocument(); diff -r f58d6ec98e88 -r b700e12870ca aknlayoutcompiler/src/MLEqCompDataParse.cpp --- a/aknlayoutcompiler/src/MLEqCompDataParse.cpp Thu Dec 17 09:14:18 2009 +0200 +++ b/aknlayoutcompiler/src/MLEqCompDataParse.cpp Mon Jan 18 21:13:05 2010 +0200 @@ -23,7 +23,7 @@ #include "MLEqCompDataParse.h" -#include +#include #include #include @@ -701,15 +701,15 @@ void TEqLayoutSaxParser::Parse(const std::string& aFileName) { - SAX::basic_InputSource is(aFileName); - SAX::XMLReader parser; + Arabica::SAX::InputSource is(aFileName); + Arabica::SAX::XMLReader parser; parser.setContentHandler(*this); parser.setErrorHandler(*this); parser.parse(is); } void TEqLayoutSaxParser::startElement(const std::string& /*namespaceURI*/, const std::string& localName, - const std::string& /*qName*/, const SAX::basic_Attributes& atts) + const std::string& /*qName*/, const Arabica::SAX::Attributes& atts) { MSaxLayoutEqHandler* handler = iStack.top(); if (!handler) diff -r f58d6ec98e88 -r b700e12870ca aknlayoutcompiler/src/MasterLayoutPack.cpp --- a/aknlayoutcompiler/src/MasterLayoutPack.cpp Thu Dec 17 09:14:18 2009 +0200 +++ b/aknlayoutcompiler/src/MasterLayoutPack.cpp Mon Jan 18 21:13:05 2010 +0200 @@ -125,7 +125,7 @@ stream << " *" << endl; stream << " If -z is specified, then instances for zoom factors" << endl; stream << " (in the form \"n,string\") appearing in the file will be generated, " << endl; - stream << " by replacing the keyword $ZOOM in the package definitions." << endl; + stream << " by replacing the keyword ZOOM in the package definitions." << endl; } void MasterLayoutPackage_Process( @@ -137,12 +137,12 @@ vector::const_iterator aEnd, const string& aZoomName) { - CCdlTkCdlFileParser parser(KDirDomainSysHeader+KMasterLayoutPackCdlFile); + CCdlTkCdlFileParser parser(CdlTkUtil::CurrentDrive()+KDirDomainSysHeader+KMasterLayoutPackCdlFile); auto_ptr iface(parser.LoadAndParse(true)); CCdlTkInstance pkg(*iface); pkg.TemplateAllImplementations(); - string zoomName = CdlTkUtil::Replace("$ZOOM", aZoomName, aName); + string zoomName = CdlTkUtil::Replace("ZOOM", aZoomName, aName); string zoomIdName = "EAknUiZoom" + aZoomName; pkg.SetName(zoomName); @@ -157,7 +157,7 @@ for (; aBegin != aEnd; ++aBegin) { - string zoomContent = CdlTkUtil::Replace("$ZOOM", aZoomName, *aBegin); + string zoomContent = CdlTkUtil::Replace("ZOOM", aZoomName, *aBegin); // pkg.AddLocalContent(zoomContent); cout << zoomContent << endl; } @@ -204,7 +204,7 @@ void MasterLayoutIndex::CreateTemplateInstance() { - CCdlTkCdlFileParser parser(KDirDomainSysHeader+KMasterLayoutPackCdlFile); + CCdlTkCdlFileParser parser(CdlTkUtil::CurrentDrive()+KDirDomainSysHeader+KMasterLayoutPackCdlFile); iIface = parser.LoadAndParse(true); iInst = auto_ptr(new CCdlTkInstance(*iIface)); iInst->TemplateAllImplementations(); @@ -295,13 +295,13 @@ string impl = "&"; string extra; - string pkgName = CdlTkUtil::Replace("$ZOOM", aZoom, aLine[EPackNameArg]); + string pkgName = CdlTkUtil::Replace("ZOOM", aZoom, aLine[EPackNameArg]); impl+=pkgName; string refs; - for (int refPos = EFirstContentArg; refPos < aLine.size(); ++refPos) + for (unsigned int refPos = EFirstContentArg; refPos < aLine.size(); ++refPos) { - string refName = CdlTkUtil::Replace("$ZOOM", aZoom, aLine[refPos]); + string refName = CdlTkUtil::Replace("ZOOM", aZoom, aLine[refPos]); CdlTkUtil::AppendString(refs, CdlTkUtil::Replace("$NAME",refName,"\tLOCAL_CDL_REF($NAME),\n")); } diff -r f58d6ec98e88 -r b700e12870ca aknlayoutcompiler/src/SaxErrorHandler.cpp --- a/aknlayoutcompiler/src/SaxErrorHandler.cpp Thu Dec 17 09:14:18 2009 +0200 +++ b/aknlayoutcompiler/src/SaxErrorHandler.cpp Mon Jan 18 21:13:05 2010 +0200 @@ -23,17 +23,17 @@ #include "SaxErrorHandler.h" -void SAXErrorHandler::warning(const SAX::SAXParseException& exception) +void SAXErrorHandler::warning(const Arabica::SAX::SAXParseException& exception) { std::cerr << "WARNING: " << exception.what() << std::endl; } // warning -void SAXErrorHandler::error(const SAX::SAXParseException& exception) +void SAXErrorHandler::error(const Arabica::SAX::SAXParseException& exception) { std::cerr << "ERROR : " << exception.what() << std::endl; } // error -void SAXErrorHandler::fatalError(const SAX::SAXParseException& exception) +void SAXErrorHandler::fatalError(const Arabica::SAX::SAXParseException& exception) { std::cerr << "FATAL : " << exception.what() << std::endl; } // fatalError diff -r f58d6ec98e88 -r b700e12870ca aknlayoutcompiler/src/ZoomLevelNames.cpp --- a/aknlayoutcompiler/src/ZoomLevelNames.cpp Thu Dec 17 09:14:18 2009 +0200 +++ b/aknlayoutcompiler/src/ZoomLevelNames.cpp Mon Jan 18 21:13:05 2010 +0200 @@ -26,9 +26,9 @@ #include "LayoutCompilerErr.h" #include "CodeGenConsts.h" -#include +#include -#include +#include #include #include @@ -71,7 +71,7 @@ while (!in.eof()) { getline(in, line); - int comma = line.find(","); + string::size_type comma = line.find(","); if(comma == string::npos) { cerr << "Zoom file incorrect format." << endl; diff -r f58d6ec98e88 -r b700e12870ca cdlcompiler/group/CdlCompiler.mmp --- a/cdlcompiler/group/CdlCompiler.mmp Thu Dec 17 09:14:18 2009 +0200 +++ b/cdlcompiler/group/CdlCompiler.mmp Mon Jan 18 21:13:05 2010 +0200 @@ -43,6 +43,8 @@ win32_library /epoc32/release/tools/rel/CdlCompilerToolkit.lib #endif END -#endif +#endif + +staticlibrary CdlCompilerToolkit // End of File diff -r f58d6ec98e88 -r b700e12870ca cdlcompiler/group/bld.inf --- a/cdlcompiler/group/bld.inf Thu Dec 17 09:14:18 2009 +0200 +++ b/cdlcompiler/group/bld.inf Mon Jan 18 21:13:05 2010 +0200 @@ -17,15 +17,15 @@ #include PRJ_PLATFORMS -TOOLS CWTOOLS +TOOLS CWTOOLS TOOLS2 PRJ_EXPORTS -../binary/CdlCompiler.EXE /epoc32/tools/CdlCompiler.exe +../binary/CdlCompiler.exe /epoc32/tools/CdlCompiler.exe PRJ_MMPFILES -#if defined(TOOLS) || defined(CWTOOLS) +#if defined(TOOLS) || defined(CWTOOLS) || defined(TOOLS2) /* * NOTICE! CdlCompiler is not compiled any more during usual build. @@ -35,7 +35,7 @@ * /epoc32/tools/AknLayoutCompiler.exe to ../binary directory and * put the binary to version control. */ -//CdlCompiler.mmp +// CdlCompiler.mmp #endif // End of File diff -r f58d6ec98e88 -r b700e12870ca cdlcompiler/src/CdlCompiler.cpp --- a/cdlcompiler/src/CdlCompiler.cpp Thu Dec 17 09:14:18 2009 +0200 +++ b/cdlcompiler/src/CdlCompiler.cpp Mon Jan 18 21:13:05 2010 +0200 @@ -22,9 +22,15 @@ #include #include #include +#include + +#ifdef __MSVCRT__ #include -#include -#include +#endif + +#include +#include +#include using namespace std; using namespace CdlCompilerToolkit; @@ -214,7 +220,7 @@ if (pArg == aArgs.end()) throw MainArgsErr("Missing package instance id"); - if (count_if(pArg->begin(), pArg->end(), CdlTkUtil::IsNumeric) == pArg->size()) + if (count_if(pArg->begin(), pArg->end(), CdlTkUtil::IsNumeric) == static_cast( pArg->size()) ) { pckg.SetId(CdlTkUtil::ParseInt(*pArg)); ++pArg; @@ -367,12 +373,13 @@ { public: CCompareModeChecker(const string& aLeft, const string& aRight); + virtual ~CCompareModeChecker(); virtual void StartCheck(); virtual void CheckComplete(); virtual void ApiInBoth(const CCdlTkApi& aApi); virtual void ApiNotInLeft(const CCdlTkApi& aApi); virtual void ApiNotInRight(const CCdlTkApi& aApi); - + private: int iErrs; string iLeft; @@ -384,6 +391,11 @@ { } +CCompareModeChecker:: ~CCompareModeChecker() + { + + } + void CCompareModeChecker::StartCheck() { iErrs = 0; @@ -569,7 +581,7 @@ if (*pArg == "client") { mode = auto_ptr(new CClientMode); - CdlTkUtil::SetOutputPath(CdlTkUtil::CurrentDrive() + "\\epoc32\\include\\"); + CdlTkUtil::SetOutputPath(CdlTkUtil::CurrentDrive() +PATHSEP+"epoc32"+PATHSEP+"include"+PATHSEP); } else if (*pArg == "instance") { diff -r f58d6ec98e88 -r b700e12870ca cdlcompilertoolkit/group/CdlCompilerToolkit.mmp --- a/cdlcompilertoolkit/group/CdlCompilerToolkit.mmp Thu Dec 17 09:14:18 2009 +0200 +++ b/cdlcompilertoolkit/group/CdlCompilerToolkit.mmp Mon Jan 18 21:13:05 2010 +0200 @@ -16,13 +16,18 @@ */ #include +#ifdef TOOLS2 +target libCdlCompilerToolkit +#else target CdlCompilerToolkit.lib +#endif + targettype LIB -USERINCLUDE ../inc +USERINCLUDE ../inc MW_LAYER_SYSTEMINCLUDE -option MSVC /GX /W3 +option MSVC /W3 /EHsc sourcepath ../src @@ -43,3 +48,4 @@ source CdlTkWriteInstance.cpp // End of File + diff -r f58d6ec98e88 -r b700e12870ca cdlcompilertoolkit/group/bld.inf --- a/cdlcompilertoolkit/group/bld.inf Thu Dec 17 09:14:18 2009 +0200 +++ b/cdlcompilertoolkit/group/bld.inf Mon Jan 18 21:13:05 2010 +0200 @@ -17,12 +17,12 @@ #include PRJ_PLATFORMS -TOOLS CWTOOLS +TOOLS CWTOOLS TOOLS2 PRJ_EXPORTS PRJ_MMPFILES -#if defined(TOOLS) || defined(CWTOOLS) +#if defined(TOOLS) || defined(CWTOOLS) || defined(TOOLS2) CdlCompilerToolkit.mmp #endif diff -r f58d6ec98e88 -r b700e12870ca cdlcompilertoolkit/src/CdlTkClientHeader.cpp --- a/cdlcompilertoolkit/src/CdlTkClientHeader.cpp Thu Dec 17 09:14:18 2009 +0200 +++ b/cdlcompilertoolkit/src/CdlTkClientHeader.cpp Mon Jan 18 21:13:05 2010 +0200 @@ -95,7 +95,7 @@ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).\n\ * All rights reserved.\n\ * This component and the accompanying materials are made available\n\ -* under the terms of \"Eclipse Public License v1.0\"\n\ +* under the terms of \"Eclipse Public License v1.0\"\n\ * which accompanies this distribution, and is available\n\ * at the URL \"http://www.eclipse.org/legal/epl-v10.html\".\n\ *\n\ @@ -116,7 +116,7 @@ #ifndef $CDLGUARD\n\ #define $CDLGUARD\n\ \n\ -#include \n\ +#include \n\ #include <$FILE.common.h>\n\ \n\ namespace $CDLNS\n\ @@ -174,7 +174,7 @@ } // end of namespace $CDLNS\n\ #endif // $CDLGUARD\n"; -const int KMsvcClassMaxSize = 1000; +const unsigned int KMsvcClassMaxSize = 1000; const string KTypeInfoOn = "on"; const string KTypeInfoOff = "off"; diff -r f58d6ec98e88 -r b700e12870ca cdlcompilertoolkit/src/CdlTkInstance.cpp --- a/cdlcompilertoolkit/src/CdlTkInstance.cpp Thu Dec 17 09:14:18 2009 +0200 +++ b/cdlcompilertoolkit/src/CdlTkInstance.cpp Mon Jan 18 21:13:05 2010 +0200 @@ -225,7 +225,10 @@ std::string CCdlTkInstance::InstanceNameToDllInstanceName(const std::string& aName) { - return CdlTkUtil::Replace("$INST", CdlTkUtil::ToCpp(aName), KDllInstanceName); + string tempName = aName; + tempName = CdlTkUtil::Replace("\r", "", tempName); + tempName = CdlTkUtil::Replace("\n", "", tempName); + return CdlTkUtil::Replace("$INST", CdlTkUtil::ToCpp(tempName), KDllInstanceName); } diff -r f58d6ec98e88 -r b700e12870ca cdlcompilertoolkit/src/CdlTkParser.cpp --- a/cdlcompilertoolkit/src/CdlTkParser.cpp Thu Dec 17 09:14:18 2009 +0200 +++ b/cdlcompilertoolkit/src/CdlTkParser.cpp Mon Jan 18 21:13:05 2010 +0200 @@ -21,7 +21,8 @@ #include using namespace std; -namespace CdlCompilerToolkit { +namespace CdlCompilerToolkit + { // // SyntaxErr @@ -189,7 +190,7 @@ { // add the line to the API buffer CdlTkUtil::AppendString(iApiBuf, line); - int pos; + string::size_type pos; // extract API declarations from the API buffer, separated by semi-colons while ((pos = iApiBuf.find_first_of(';')) != string::npos) { @@ -239,7 +240,6 @@ { if (aLine.size() < aHeader.size() || aLine.substr(0, aHeader.size()) != aHeader) return false; - aVal = aLine.substr(aHeader.size()); StripComments(aVal, iComment); CdlTkUtil::StripLeadingAndTrailingWhitespace(aVal); @@ -248,7 +248,7 @@ void CCdlTkCdlFileParser::StripComments(string& aStr, string& aComment) { - int pos = aStr.find(KCommentStart); + string::size_type pos = aStr.find(KCommentStart); if (pos != string::npos) { aComment += aStr.substr(pos) + "\n"; @@ -263,7 +263,7 @@ if (isFunc) { auto_ptr pFuncApi(new CCdlTkFunctionApi(aCdl)); - int paramStart = aLine.find('('); + string::size_type paramStart = aLine.find('('); if (paramStart == string::npos) SyntaxError("function has missing '('"); string params = aLine.substr(paramStart); @@ -291,7 +291,7 @@ { while (aList.size()) { - int pos = aList.find(','); + string::size_type pos = aList.find(','); string param = aList.substr(0, pos); aList = aList.substr(param.size() + (pos == string::npos ? 0 : 1)); CdlTkUtil::StripLeadingAndTrailingWhitespace(aList); @@ -306,7 +306,7 @@ void CCdlTkCdlFileParser::ParseNameTypeAndDefaultValue(string& aStr, string& aName, string& aType, string& aDefaultValue) { CdlTkUtil::StripLeadingAndTrailingWhitespace(aStr); - int eq = aStr.find_last_of(KEqualsSign); + string::size_type eq = aStr.find_last_of(KEqualsSign); if(eq != string::npos) { aDefaultValue = aStr.substr(eq + 1); @@ -326,10 +326,10 @@ void CCdlTkCdlFileParser::ParseTranslationText(CCdlTkDataTypeTranslation& aTrans, string& aLine) { - int pos1 = aLine.find('#'); + string::size_type pos1 = aLine.find('#'); if (pos1 == string::npos) SyntaxError("First # not found"); - int pos2 = aLine.find('#', pos1+1); + string::size_type pos2 = aLine.find('#', pos1+1); if (pos2 == string::npos) SyntaxError("Second # not found"); if (aLine.find('#', pos2+1) != string::npos) diff -r f58d6ec98e88 -r b700e12870ca cdlcompilertoolkit/src/CdlTkProcess.cpp --- a/cdlcompilertoolkit/src/CdlTkProcess.cpp Thu Dec 17 09:14:18 2009 +0200 +++ b/cdlcompilertoolkit/src/CdlTkProcess.cpp Mon Jan 18 21:13:05 2010 +0200 @@ -31,7 +31,7 @@ string CCdlTkProcess::CdlBaseNameAndPath(const CCdlTkInterface& aCdl) { - return CdlTkUtil::ToLower(CdlTkUtil::OutputPath() + CdlTkUtil::StripPath(aCdl.FileName())); + return CdlTkUtil::OutputPath() + CdlTkUtil::ToLower(CdlTkUtil::StripPath(aCdl.FileName())); } void CCdlTkProcess::AssertInterfaceNotExtended(const CCdlTkInterface& aCdl) diff -r f58d6ec98e88 -r b700e12870ca cdlcompilertoolkit/src/CdlTkSyntaxCheck.cpp --- a/cdlcompilertoolkit/src/CdlTkSyntaxCheck.cpp Thu Dec 17 09:14:18 2009 +0200 +++ b/cdlcompilertoolkit/src/CdlTkSyntaxCheck.cpp Mon Jan 18 21:13:05 2010 +0200 @@ -14,11 +14,18 @@ * Description: * */ -#include "CdlCompilerToolkit/CdlTkProcess.h" +#include +#include #include "CdlTkPriv.h" #include #include + +#ifdef CDL_W32 #include +#else +#include +#define _getcwd getcwd +#endif #include using namespace std; diff -r f58d6ec98e88 -r b700e12870ca cdlcompilertoolkit/src/CdlTkUtil.cpp --- a/cdlcompilertoolkit/src/CdlTkUtil.cpp Thu Dec 17 09:14:18 2009 +0200 +++ b/cdlcompilertoolkit/src/CdlTkUtil.cpp Mon Jan 18 21:13:05 2010 +0200 @@ -23,7 +23,18 @@ #include #include #include +#include + +#include + +#ifdef CDL_W32 #include +#else +#include + +#define _getcwd getcwd +#endif + using namespace std; namespace CdlCompilerToolkit { @@ -113,6 +124,7 @@ // CdlTkUtil // +#ifdef CDL_W32 string CdlTkUtil::CurrentDrive() { static string drive = "?:"; @@ -120,6 +132,15 @@ drive[0] = 'A' + _getdrive() - 1; return drive; } +#else // Linux +string CdlTkUtil::CurrentDrive() + { + char *epocroot = getenv("EPOCROOT"); + assert(epocroot != NULL); + + return std::string(epocroot); + } +#endif string CdlTkUtil::CurrentDir() { @@ -127,8 +148,13 @@ if (dir == "") { char buf[256]; +#ifdef CDL_W32 dir = _getcwd(buf, 255) + 2; // +2 removes drive - dir += "\\"; +#else +//for linux + dir = _getcwd(buf, 255); +#endif + dir += PATHSEP; } return dir; } @@ -146,9 +172,9 @@ { gOutputPath = aPath; if (gOutputPath.size() == 0) - gOutputPath += ".\\"; - else if (gOutputPath[gOutputPath.size()-1] != '\\') - gOutputPath += "\\"; // CDL Tk convention is that paths always end in \ + gOutputPath += PATHSEP; + else if (! IsPathSeparator( gOutputPath[gOutputPath.size()-1] ) ) + gOutputPath += PATHSEP; // CDL Tk convention is that paths always end in backslash. } string CdlTkUtil::ToLower(const string& aString) @@ -170,6 +196,9 @@ string CdlTkUtil::ToCpp(const string& aString) { string r = aString; + r = Replace("\r", "", r); + r = Replace("\n", "", r); + for (string::iterator pC = r.begin(); pC != r.end(); ++pC) { if (!CdlTkUtil::IsCpp(*pC)) @@ -182,14 +211,14 @@ string CdlTkUtil::StripPath(const string& aPath) { - return aPath.substr(aPath.rfind('\\')+1); + return aPath.substr( FindLastPathSeparator(aPath) + 1 ); } string CdlTkUtil::ResolvePath(const string& aPath, const string& aFileName) { int size = aFileName.size(); // if aFileName is absolute, return it - if (size > 0 && aFileName[0] == '\\' || size > 1 && aFileName[1] == ':') + if (size > 0 && IsPathSeparator( aFileName[0] ) || size > 1 && aFileName[1] == ':') return aFileName; string path = aPath; @@ -202,11 +231,11 @@ if (file.size() > 1 && file[1]=='.' && !path.empty()) { path.resize(path.size()-1); // remove the last slash - path.resize(path.rfind('\\')+1); // remove everything after the next last slash + path.resize( FindLastPathSeparator(path) + 1 ); // remove everything after the next last slash } // chop the head directory off the file - it has to have a '\' if it has a '.' - int fileSlashPos = file.find('\\'); + string::size_type fileSlashPos = FindFirstPathSeparator( file ); if (fileSlashPos == string::npos) throw CdlTkAssert("Illegal filename"); file = file.substr(fileSlashPos + 1); @@ -221,7 +250,7 @@ // convert the whole thing to lower case string res = ToLower(aString); // find the first character after the last \ - will be 0 if no \ is present. - int filenamePos = res.find_last_of('\\') + 1; + string::size_type filenamePos = FindLastPathSeparator(res) + 1; if (filenamePos >= res.size()) throw CdlTkAssert(aString + " has no filename"); // uppercase the first character @@ -349,10 +378,19 @@ void CdlTkUtil::OpenTempOutput(ofstream& aStream, CCdlTkFileCleanup& aFile, ios_base::openmode aOpenMode) { char tmpName[256]; +#ifdef CDL_W32 if (!tmpnam(tmpName)) { throw CdlTkAssert("Can't create temporary file name"); } +#else + strcpy(tmpName, "cdltkutilXXXXXX"); + + if (-1 == mkstemp(tmpName)) + { + throw CdlTkAssert("Can't create temporary file name"); + } +#endif OpenOutput(aStream, tmpName, aOpenMode); aFile.Set(tmpName); @@ -363,7 +401,7 @@ aStream.open(aFileName.c_str(), aOpenMode); if (!aStream.is_open()) { - throw CdlTkFileOpenErr(aFileName); + //throw CdlTkFileOpenErr(aFileName); } } @@ -425,7 +463,7 @@ void CdlTkUtil::StripLeadingAndTrailingWhitespace(string& aStr) { - int pos = aStr.find_first_not_of(KWhiteSpace); + string::size_type pos = aStr.find_first_not_of(KWhiteSpace); if (pos == string::npos) { aStr = KEmptyString; @@ -451,6 +489,38 @@ return IsAlpha(aChar) || IsNumeric(aChar) || aChar == '_'; } +bool CdlTkUtil::IsPathSeparator(char aChar) + { + return aChar == '/' || aChar == '\\'; + } + +std::string::size_type CdlTkUtil::FindFirstPathSeparator(const std::string& s) + { + std::string::size_type f = s.find(FORWARDSLASH); + std::string::size_type b = s.find(BACKSLASH); + + if(f == std::string::npos) + return b; + + if(b == std::string::npos) + return f; + + return f < b ? f : b; + } + +std::string::size_type CdlTkUtil::FindLastPathSeparator(const std::string& s) + { + std::string::size_type f = s.rfind(FORWARDSLASH); + std::string::size_type b = s.rfind(BACKSLASH); + + if(f == std::string::npos) + return b; + + if(b == std::string::npos) + return f; + + return f > b ? f : b; + } void ZeroInts(int* aInts, int aCount) { for (int ii=0; ii( targetMatch ) == target.size()) { AppendString(ret, aIn.substr(lastMatch, pos - targetMatch - lastMatch)); AppendString(ret, aSet[ii].second); @@ -501,7 +571,7 @@ void CdlTkUtil::AppendString(string& aTarget, const string& aAppend) { - int resSize = aTarget.size() + aAppend.size(); + string::size_type resSize = aTarget.size() + aAppend.size(); if (aTarget.capacity() < resSize) aTarget.reserve(resSize*2); aTarget.append(aAppend); @@ -517,7 +587,8 @@ void CdlTkUtil::SetCommandLine(int argc, char* argv[]) { string tool(argv[0]); - tool = tool.substr(tool.find_last_of('\\') + 1); + + tool = StripPath( tool ); gCommandLine = tool.substr(0, tool.find_last_of('.')); for (int ii=1; ii\n\ -#include \n\ +#include \n\ \n\ CDL_ECOM_MAIN_REG_WITH_VERSION(0x$DLLUID, $DLLVER)\n"; @@ -365,7 +376,7 @@ { string dllUid = CdlTkUtil::IntToHexString(iDll.Uid()).substr(2); string dllVer = CdlTkUtil::IntToString(iDll.Version()); - string name = CdlTkUtil::ToLower(CdlTkUtil::OutputPath() + dllUid + ".rss"); + string name = CdlTkUtil::OutputPath() + CdlTkUtil::ToLower(dllUid + ".rss"); ofstream stream; CCdlTkFileCleanup tempFile; CdlTkUtil::OpenTempOutput(stream, tempFile); @@ -398,8 +409,8 @@ * Description:\n\ *\n\ */\n\n\ -#include \n\ -#include \n\ +#include \n\ +#include \n\ \n\ $INCLUDES\ \n\ @@ -413,7 +424,7 @@ void CCdlTkWriteDll::WriteEcomDetailRss() const { string dllUid = CdlTkUtil::IntToHexString(iDll.Uid()).substr(2); - string name = CdlTkUtil::ToLower(CdlTkUtil::OutputPath() + dllUid + "_cdl_detail.rss"); + string name = CdlTkUtil::OutputPath() + CdlTkUtil::ToLower(dllUid + "_cdl_detail.rss"); ofstream stream; CCdlTkFileCleanup tempFile; CdlTkUtil::OpenTempOutput(stream, tempFile); @@ -423,10 +434,12 @@ CCdlTkDll::CInstances::const_iterator begin = iDll.Instances().begin(); for (CCdlTkDll::CInstances::const_iterator pName = begin; pName != iDll.Instances().end(); ++pName) { + string tempPName = CdlTkUtil::Replace("\r", "", *pName); + tempPName = CdlTkUtil::Replace("\n", "", tempPName); string instance = (pName != begin) ? "," : ""; - instance += CdlTkUtil::Replace("$CPP_NAME", CdlTkUtil::ToCpp(*pName), KDetailRssInstance); + instance += CdlTkUtil::Replace("$CPP_NAME", CdlTkUtil::ToCpp(tempPName), KDetailRssInstance); CdlTkUtil::AppendString(instances, instance); - CdlTkUtil::AppendString(includes, CdlTkUtil::Replace("$NAME", CdlTkUtil::ToLower(*pName), KDetailRssInclude)); + CdlTkUtil::AppendString(includes, CdlTkUtil::Replace("$NAME", CdlTkUtil::ToLower(tempPName), KDetailRssInclude)); } CdlTkUtil::CReplaceSet rssSet; diff -r f58d6ec98e88 -r b700e12870ca cdlcompilertoolkit/src/CdlTkWriteInstance.cpp --- a/cdlcompilertoolkit/src/CdlTkWriteInstance.cpp Thu Dec 17 09:14:18 2009 +0200 +++ b/cdlcompilertoolkit/src/CdlTkWriteInstance.cpp Mon Jan 18 21:13:05 2010 +0200 @@ -36,7 +36,9 @@ void CCdlTkWriteInstance::Process() { - string implName = CdlTkUtil::ToLower(CdlTkUtil::OutputPath() + CdlTkUtil::StripPath(iInstance.Name())); + string implName = CdlTkUtil::ToLower( CdlTkUtil::StripPath(iInstance.Name())); + implName = CdlTkUtil::Replace("\r","",implName); + implName = CdlTkUtil::Replace("\n","",implName); string headerName(implName + ".h"); InitReplace(headerName); ProcessCdl(); @@ -47,30 +49,35 @@ CdlTkUtil::OpenTempOutput(hrhStream, tempFile); ProcessInstanceHrh(hrhStream, headerName+"rh"); hrhStream.close(); - CdlTkUtil::ExportFileIfWritable(tempFile, headerName+"rh"); + CdlTkUtil::ExportFileIfWritable(tempFile, CdlTkUtil::OutputPath() + headerName+"rh"); ofstream headerStream; CdlTkUtil::OpenTempOutput(headerStream, tempFile); ProcessInstanceHeader(headerStream, headerName); headerStream.close(); - CdlTkUtil::ExportFileIfWritable(tempFile, headerName); + CdlTkUtil::ExportFileIfWritable(tempFile, CdlTkUtil::OutputPath() + headerName); ofstream cppStream; CdlTkUtil::OpenTempOutput(cppStream, tempFile); ProcessInstance(cppStream, headerName); cppStream.close(); - CdlTkUtil::ExportFileIfWritable(tempFile, CdlTkUtil::CorrectFilenameCase(implName + ".cpp")); + + CdlTkUtil::ExportFileIfWritable(tempFile, CdlTkUtil::OutputPath() + CdlTkUtil::CorrectFilenameCase(implName + ".cpp")); } void CCdlTkWriteInstance::InitReplace(const std::string& aHeaderName) { iReplace.clear(); - iReplace.Add("$INSTNAME", iInstance.Name()); + string instanceName = iInstance.Name(); + instanceName = CdlTkUtil::Replace("\r", "", instanceName); + instanceName = CdlTkUtil::Replace("\n", "", instanceName); + iReplace.Add("$INSTNAME", instanceName); iReplace.Add("$CDLNAME", CdlTkUtil::StripPath(iCdl.FileName())); iReplace.Add("$CDLINCNAME", CdlTkUtil::ToLower(CdlTkUtil::StripPath(iCdl.FileName()))); iReplace.Add("$HEADERNAME", CdlTkUtil::ToLower(CdlTkUtil::StripPath(aHeaderName))); iReplace.Add("$EXTRA", iInstance.ExtraCpp()); iReplace.Add("$INSTNS", CdlTkUtil::ToCpp(iInstance.Name())); + iReplace.Add("$CDLNS", iCdl.NamespaceName()); iReplace.Add("$CDLGUARD", HeaderGuardName(iCdl.FileName() + ".custom.h")); iReplace.Add("$INSTGUARD", HeaderGuardName(aHeaderName)); @@ -92,7 +99,6 @@ AssertInterfaceNotExtended(iCdl); string baseName = CdlBaseNameAndPath(iCdl); - string commonHeaderName(baseName + KCommonHeader); CCdlTkWriteCommonDefs::ExportCommonDefs(iCdl, commonHeaderName); diff -r f58d6ec98e88 -r b700e12870ca toollibraries/group/bld.inf --- a/toollibraries/group/bld.inf Thu Dec 17 09:14:18 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,19 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -#include "../xercesc/group/bld.inf" -#include "../arabica/group/bld.inf" \ No newline at end of file diff -r f58d6ec98e88 -r b700e12870ca uitools_plat/cdl_api/group/bld.inf --- a/uitools_plat/cdl_api/group/bld.inf Thu Dec 17 09:14:18 2009 +0200 +++ b/uitools_plat/cdl_api/group/bld.inf Mon Jan 18 21:13:05 2010 +0200 @@ -29,3 +29,5 @@ ../inc/CdlCompilerToolkit/CdlTkInterface.h MW_LAYER_PLATFORM_EXPORT_PATH(CdlCompilerToolkit/CdlTkInterface.h) ../inc/CdlCompilerToolkit/CdlTkUtil.h MW_LAYER_PLATFORM_EXPORT_PATH(CdlCompilerToolkit/CdlTkUtil.h) ../inc/CdlCompilerToolkit/CdlTkProcess.h MW_LAYER_PLATFORM_EXPORT_PATH(CdlCompilerToolkit/CdlTkProcess.h) +../inc/CdlCompilerToolkit/CdlCompat.h MW_LAYER_PLATFORM_EXPORT_PATH(CdlCompilerToolkit/CdlCompat.h) + diff -r f58d6ec98e88 -r b700e12870ca uitools_plat/cdl_api/inc/CdlCompilerToolkit/CdlCompat.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/uitools_plat/cdl_api/inc/CdlCompilerToolkit/CdlCompat.h Mon Jan 18 21:13:05 2010 +0200 @@ -0,0 +1,23 @@ +// Cdlcompat.h + +#ifndef CDLCOMPAT_H +#define CDLCOMPAT_H + +/* _MSC_VER for checking VC6, so that we can keep this library still compilable using `tools'. */ +#if (defined(__MSVCRT__) || defined(_MSC_VER)) +#define CDL_W32 +#endif + +// path separator +/* #ifdef CDL_W32 */ +/* #define PATHSEP "\\" */ +/* #define PATHSEPCHAR '\\' */ +/* #else */ +#define PATHSEP "/" +#define PATHSEPCHAR '/' +/* #endif */ + +const char FORWARDSLASH = '/'; +const char BACKSLASH = '\\'; + +#endif diff -r f58d6ec98e88 -r b700e12870ca uitools_plat/cdl_api/inc/CdlCompilerToolkit/CdlTkInterface.h --- a/uitools_plat/cdl_api/inc/CdlCompilerToolkit/CdlTkInterface.h Thu Dec 17 09:14:18 2009 +0200 +++ b/uitools_plat/cdl_api/inc/CdlCompilerToolkit/CdlTkInterface.h Mon Jan 18 21:13:05 2010 +0200 @@ -455,7 +455,7 @@ // member data used in Match() calculation std::string iTextBeforeTypeVar; std::string iTextAfterTypeVar; - int iTypeVarPos; + std::string::size_type iTypeVarPos; int iSizeAfterTypeVar; int iTypeSize; int iTypeSizeWithoutTypeVar; diff -r f58d6ec98e88 -r b700e12870ca uitools_plat/cdl_api/inc/CdlCompilerToolkit/CdlTkProcess.h --- a/uitools_plat/cdl_api/inc/CdlCompilerToolkit/CdlTkProcess.h Thu Dec 17 09:14:18 2009 +0200 +++ b/uitools_plat/cdl_api/inc/CdlCompilerToolkit/CdlTkProcess.h Mon Jan 18 21:13:05 2010 +0200 @@ -20,8 +20,11 @@ #include #include #include +#include namespace CdlCompilerToolkit { +class CCdlTkApi; +class CCdlTkInterface; /** * CCdlTkProcess @@ -385,6 +388,8 @@ * Called when an API is found that is only in the left hand interface */ virtual void ApiNotInRight(const CCdlTkApi& aApi) = 0; + + virtual ~MCdlTkApiCheckObserver(){} }; /** diff -r f58d6ec98e88 -r b700e12870ca uitools_plat/cdl_api/inc/CdlCompilerToolkit/CdlTkUtil.h --- a/uitools_plat/cdl_api/inc/CdlCompilerToolkit/CdlTkUtil.h Thu Dec 17 09:14:18 2009 +0200 +++ b/uitools_plat/cdl_api/inc/CdlCompilerToolkit/CdlTkUtil.h Mon Jan 18 21:13:05 2010 +0200 @@ -145,6 +145,14 @@ */ static bool IsCpp(char aChar); + /** + * Is the character equal to '\\' or '/' ? + * @param aChar the character to test + * @return true if the character is a path separator + */ + static bool IsPathSeparator(char aChar); + static std::string::size_type FindFirstPathSeparator(const std::string& s); + static std::string::size_type FindLastPathSeparator(const std::string& s); /** * This class contains a set of terms to replace in a string. It is used * with CdlTkUtil::MultiReplace(). @@ -276,7 +284,7 @@ std::string::const_iterator pWord = pChar; for (; ; ++pChar) { - if (pChar == aString.end() || ws.find_first_of(*pChar) != string::npos) + if (pChar == aString.end() || ws.find_first_of(*pChar) != std::string::npos) { if (pWord != pChar) {