See into S60
» Subscribe
» Favorite Links
» What is S60?
» Freeware & Trials
» S60 devices
» Hints and tips

» About this blog
» Blognotes (15)
» Bugs and Workarounds (4)
» Build tools (5)
» Carbide.c++ 1.1 (4)
» Carbide.c++ 1.2 (8)
» Carbide.c++ 1.3.x (8)
» Carbide.c++ 2.0.x (1)
» Carbide Plug-Ins (4)
» CodeWarrior (2)
» FAQ (6)
» Future directions (24)
» General (46)
» Off-topic (4)
» On-device debugging (13)
» Performance Investigator (2)
» Product features (16)
» Product releases (16)
» Screencast (12)
» Support (30)
» Tool setup (5)
» UI Designer (8)
» Usability (15)
» Work in Progress (13)
» Write-build-debug (4)
» Tommi's Reports from Wonderland
» Voice of S60
» Creating Carbide C++
» S60 Multimedia Blog
» The Convergence Zone
» Web Browser for S60 Blog
» Consumed by S60
» Java for S60
» Mobile Web Server
» Mobile Security
» See into S60
» Business2GO
» Nokia Podcasting Application Blog
» Launching from the SPN View
» Tips for using the CodeScanner tool!
» Carbide in the summer
» Austin Eclipse DemoCamp
» Where's my console output?
» July 2008
» June 2008
» May 2008
» April 2008
» March 2008
» February 2008
» August 2007
» May 2007
» April 2007
» March 2007
» February 2007
» January 2007
» December 2006
» November 2006
» October 2006
» September 2006
» August 2006
» July 2006
» June 2006
Subscribe
Links
May 13, 2008 Carbide.c++ SDK: Reading MMP Statements with the EpocEngine and IMMPData Posted by Tim Kelly at 08:21 PM | Categories:

In a previous blog entry I gave a quick overview of some of the basic Carbide.c++ SDK APIs and managers. This topic I'll quickly show how you can read the MMP data for any build configuration (ICarbideBuildConfiguration). The main interface for retrieving MMP data is "com.nokia.carbide.cpp.epoc.engine.model.mmp.IMMPData". Once you get access to this interface you can learn anything you want to about a particular MMP file.

Prerequisite: All MMP and bld.inf parsing requires a dependency to the plugin "com.nokia.carbide.cpp.epoc.engine".

Typically most keywords of interest are either single string settings (TARGETTYPE, TARGET, EPOCSTACKSIZE) or list of settings (MACRO, CAPABILITY, LANG). Other types can be directly retrieved from IMMPData routines so check the API documentation for specifics.

The example provided simply iterates through all the MMP files of a particular build configuration and grabs a list value and single item setting. You'll need to get the particular MMP file you are interested in. Play around with the IMMPData object in the run method and you can quickly get the idea.

// Assumes buildConfig (ICarbideBuildConfiguration) is known
for (IPath mmpPath : EpocEngineHelper.getMMPFilesForBuildConfiguration(buildConfig)) {
     Object data = EpocEnginePlugin.runWithMMPData(mmpPath,  new 
                           DefaultMMPViewConfiguration(buildConfig.getCarbideProject().getProject(), 
                           buildConfig, new AcceptedNodesViewFilter()),  new MMPDataRunnableAdapter() {
     
               public Object run(IMMPData mmpData) {
                    // Example, getting a keyword as a list of strings
                    List macros = mmpData.getListArgumentSettings().get(EMMPStatement.MACRO);
                    // The real return value, getting a single argument setting
                   return mmpData.getSingleArgumentSettings().get(EMMPStatement.TARGETTYPE);		
	      }
     });
// Make sure to test for and cast to proper Object type!
String mmpStatement = (String)data;  // Now we should have the TARGETTYPE
}

Permalink |


Post a comment







«Back to previous page