org.eclipse.cdt.make.internal.core.scannerconfig
Class ScannerConfigUtil

java.lang.Object
  extended by org.eclipse.cdt.make.internal.core.scannerconfig.ScannerConfigUtil

public final class ScannerConfigUtil
extends java.lang.Object

Utility class that handles some Scanner Config specifig collection conversions

Author:
vhirsl

Constructor Summary
ScannerConfigUtil()
           
 
Method Summary
static java.lang.String getSymbolKey(java.lang.String symbol)
          Returns a symbol key (i.e. for DEF=1 returns DEF)
static java.lang.String getSymbolValue(java.lang.String symbol)
          Returns a symbol value (i.e. for DEF=1 returns 1)
static java.lang.String[] iPathArray2StringArray(org.eclipse.core.runtime.IPath[] paths)
          Converts array of IPath-s to array of String-s
static void removeSymbolEntryValue(java.lang.String symbol, java.util.Map symbolEntryMap)
          Removes a symbol value from the symbol entry.
static boolean scAddSymbolEntryMap2SymbolEntryMap(java.util.Map result, java.util.Map addend)
           
static boolean scAddSymbolsList2SymbolEntryMap(java.util.Map sumSymbols, java.util.List symbols, boolean active)
          Adds all new discovered symbols/values to the existing ones.
static boolean scAddSymbolString2SymbolEntryMap(java.util.Map symbols, java.lang.String symbol, boolean active)
          Adds a single symbol definition string ("DEBUG_LEVEL=4") to the SymbolEntryMap
static java.util.Map scSymbolEntryMap2Map(java.util.Map sumSymbols)
          MapsSymbolEntryMap to a plain Map
static java.util.List scSymbolsSymbolEntryMap2List(java.util.Map sumSymbols, boolean active)
          Gets all discovered symbols with either active or removed values
static java.util.LinkedHashMap swapIncludePaths(java.util.LinkedHashMap sumPaths, int index1, int index2)
          Swaps two include paths in the include paths Map.
static java.lang.String[] tokenizeStringWithQuotes(java.lang.String line, java.lang.String quoteStyle)
          Tokenizes string with quuotes
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScannerConfigUtil

public ScannerConfigUtil()
Method Detail

scAddSymbolsList2SymbolEntryMap

public static boolean scAddSymbolsList2SymbolEntryMap(java.util.Map sumSymbols,
                                                      java.util.List symbols,
                                                      boolean active)
Adds all new discovered symbols/values to the existing ones.

Parameters:
sumSymbols - - a map of [String, Map] where Map is a SymbolEntry
symbols -
Returns:
boolean

scSymbolsSymbolEntryMap2List

public static java.util.List scSymbolsSymbolEntryMap2List(java.util.Map sumSymbols,
                                                          boolean active)
Gets all discovered symbols with either active or removed values

Parameters:
sumSymbols -
active - - false = removed
Returns:

scSymbolEntryMap2Map

public static java.util.Map scSymbolEntryMap2Map(java.util.Map sumSymbols)
MapsSymbolEntryMap to a plain Map

Parameters:
sumSymbols - (in) - discovered symbols in SymbolEntryMap
Returns:
- active symbols as a plain Map

scAddSymbolString2SymbolEntryMap

public static boolean scAddSymbolString2SymbolEntryMap(java.util.Map symbols,
                                                       java.lang.String symbol,
                                                       boolean active)
Adds a single symbol definition string ("DEBUG_LEVEL=4") to the SymbolEntryMap

Parameters:
symbols -
symbol -
active -

scAddSymbolEntryMap2SymbolEntryMap

public static boolean scAddSymbolEntryMap2SymbolEntryMap(java.util.Map result,
                                                         java.util.Map addend)
Parameters:
result - (out)
addend - (in)
Returns:

getSymbolKey

public static java.lang.String getSymbolKey(java.lang.String symbol)
Returns a symbol key (i.e. for DEF=1 returns DEF)

Parameters:
symbol - - in
key - - out

getSymbolValue

public static java.lang.String getSymbolValue(java.lang.String symbol)
Returns a symbol value (i.e. for DEF=1 returns 1)

Parameters:
symbol - - in
key - - out (may be null)

removeSymbolEntryValue

public static void removeSymbolEntryValue(java.lang.String symbol,
                                          java.util.Map symbolEntryMap)
Removes a symbol value from the symbol entry. If it was an only value than it symbol entry will be removed alltogether.

Parameters:
symbol -
symbolEntryMap - map of [symbol's key, symbolEntry]

swapIncludePaths

public static java.util.LinkedHashMap swapIncludePaths(java.util.LinkedHashMap sumPaths,
                                                       int index1,
                                                       int index2)
Swaps two include paths in the include paths Map. Used by Up/Down discovered paths

Parameters:
sumPaths -
index1 -
index2 -
Returns:
new map of include paths

tokenizeStringWithQuotes

public static java.lang.String[] tokenizeStringWithQuotes(java.lang.String line,
                                                          java.lang.String quoteStyle)
Tokenizes string with quuotes

Parameters:
String -
Returns:
String[]

iPathArray2StringArray

public static java.lang.String[] iPathArray2StringArray(org.eclipse.core.runtime.IPath[] paths)
Converts array of IPath-s to array of String-s

Parameters:
paths -
Returns: