Class CDataUtil
java.lang.Object
org.eclipse.cdt.core.settings.model.util.CDataUtil
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ICSourceEntry
addExcludePaths
(ICSourceEntry entry, Collection<org.eclipse.core.runtime.IPath> paths, boolean removePrefix) static ICExclusionPatternPathEntry
addRemoveExclusionsToEntry
(ICExclusionPatternPathEntry entry, org.eclipse.core.runtime.IPath[] paths, boolean add) static CConfigurationData
adjustConfig
(CConfigurationData cfg, CDataFactory factory) static ICOutputEntry[]
adjustEntries
(ICOutputEntry[] entries, boolean makeAbsolute, org.eclipse.core.resources.IProject project) static ICSourceEntry[]
adjustEntries
(ICSourceEntry[] entries) static ICSourceEntry[]
adjustEntries
(ICSourceEntry[] entries, boolean makeAbsolute, org.eclipse.core.resources.IProject project) static String
arrayToString
(Object[] array, String separator) static String
arrayToString
(String[] array, String separator) static boolean
canExclude
(org.eclipse.core.runtime.IPath path, boolean isFolder, boolean excluded, ICSourceEntry[] entries) static CIncludeFileEntry
createCIncludeFileEntry
(String name, int flags) Utility method to createCIncludeFileEntry
.static CIncludePathEntry
createCIncludePathEntry
(String name, int flags) Utility method to createCIncludePathEntry
.static CLibraryFileEntry
createCLibraryFileEntry
(String name, int flags) Utility method to createCLibraryFileEntry
.static CLibraryPathEntry
createCLibraryPathEntry
(String name, int flags) Utility method to createCLibraryPathEntry
.static CMacroEntry
createCMacroEntry
(String name, String value, int flags) Utility method to createCMacroEntry
.static CMacroFileEntry
createCMacroFileEntry
(String name, int flags) Utility method to createCMacroFileEntry
.static CConfigurationData
createEmptyData
(String id, String name, CDataFactory factory, boolean performLangAdjustment) static ICSettingEntry
createEntry
(int kind, String name, String value, org.eclipse.core.runtime.IPath[] exclusionPatterns, int flags) Convenience method to createICSettingEntry
depending on kind.static ICSettingEntry
createEntry
(int kind, String name, String value, org.eclipse.core.runtime.IPath[] exclusionPatterns, int flags, org.eclipse.core.runtime.IPath sourceAttachmentPath, org.eclipse.core.runtime.IPath sourceAttachmentRootPath, org.eclipse.core.runtime.IPath sourceAttachmentPrefixMapping) Convenience method to createICSettingEntry
depending on kind.static ICLanguageSettingEntry
createEntry
(ICLanguageSettingEntry entry, int flags) Convenience method to cloneICLanguageSettingEntry
with different flags.static ICLanguageSettingEntry
createEntry
(ICLanguageSettingEntry entry, int flagsToAdd, int flafsToClear) Convenience method to cloneICLanguageSettingEntry
with modified flags.static Map<org.eclipse.core.runtime.IPath,
CResourceData> static PathSettingsContainer
static Map<EntryContentsKey,
ICSettingEntry> fillEntriesMapByContentsKey
(Map<EntryContentsKey, ICSettingEntry> map, ICSettingEntry[] entries) static Map<EntryNameKey,
ICSettingEntry> fillEntriesMapByNameKey
(Map<EntryNameKey, ICSettingEntry> map, ICSettingEntry[] entries) static CLanguageData
findLanguagDataForFile
(String fileName, org.eclipse.core.resources.IProject project, CFolderData fData) static CLanguageData
findLanguagDataForFile
(String fileName, org.eclipse.core.resources.IProject project, CLanguageData[] datas) static CLanguageData
findLanguageDataForExtension
(String ext, CLanguageData[] datas) static String
static int
static boolean
getBoolean
(ICStorageElement el, String attr, boolean defaultValue) static String[]
getContentTypeFileSpecs
(org.eclipse.core.resources.IProject project, org.eclipse.core.runtime.content.IContentType type) static String[]
getExtensionsFromContentTypes
(org.eclipse.core.resources.IProject project, String[] typeIds) static int
getInteger
(ICStorageElement el, String attr, int defaultValue) static <T extends ICSettingEntry>
TgetPooledEntry
(T entry) Return entry cached in setting entries pool to optimize for memory usage.static String[]
getSourceExtensions
(org.eclipse.core.resources.IProject project, CLanguageData data) static boolean
isEqual
(ICSourceEntry[] ein, ICSourceEntry[] aus) static boolean
isExcluded
(org.eclipse.core.runtime.IPath path, ICSourceEntry entry) static boolean
isExcluded
(org.eclipse.core.runtime.IPath path, ICSourceEntry[] entries) static boolean
isOnSourceEntry
(org.eclipse.core.runtime.IPath path, ICSourceEntry entry) static ICExclusionPatternPathEntry[]
makeAbsolute
(org.eclipse.core.resources.IProject project, ICExclusionPatternPathEntry[] entries, boolean force) static ICExclusionPatternPathEntry
makeAbsolute
(org.eclipse.core.resources.IProject project, ICExclusionPatternPathEntry entry, boolean force) static ICOutputEntry
makeAbsolute
(org.eclipse.core.resources.IProject project, ICOutputEntry entry) static ICOutputEntry[]
makeAbsolute
(org.eclipse.core.resources.IProject project, ICOutputEntry[] entries) static ICSourceEntry
makeAbsolute
(org.eclipse.core.resources.IProject project, ICSourceEntry entry) static ICSourceEntry[]
makeAbsolute
(org.eclipse.core.resources.IProject project, ICSourceEntry[] entries) static ICExclusionPatternPathEntry[]
makeRelative
(org.eclipse.core.resources.IProject project, ICExclusionPatternPathEntry[] entries, boolean force) static ICExclusionPatternPathEntry
makeRelative
(org.eclipse.core.resources.IProject project, ICExclusionPatternPathEntry entry, boolean force) static ICOutputEntry
makeRelative
(org.eclipse.core.resources.IProject project, ICOutputEntry entry) static ICOutputEntry[]
makeRelative
(org.eclipse.core.resources.IProject project, ICOutputEntry[] entries) static ICSourceEntry
makeRelative
(org.eclipse.core.resources.IProject project, ICSourceEntry entry) static ICSourceEntry[]
makeRelative
(org.eclipse.core.resources.IProject project, ICSourceEntry[] entries) static boolean
objectsEqual
(Object o1, Object o2) Deprecated.static ICLanguageSettingEntry[]
resolveEntries
(ICLanguageSettingEntry[] entries, ICConfigurationDescription cfgDes) static ICOutputEntry[]
resolveEntries
(ICOutputEntry[] entries, ICConfigurationDescription cfgDes) static ICSettingEntry[]
resolveEntries
(ICSettingEntry[] entries, ICConfigurationDescription cfgDes) static ICSourceEntry[]
resolveEntries
(ICSourceEntry[] entries, ICConfigurationDescription cfgDes) static void
setBoolean
(ICStorageElement el, String attr, boolean value) static ICSourceEntry[]
setExcluded
(org.eclipse.core.runtime.IPath path, boolean isFolder, boolean excluded, ICSourceEntry[] entries) static ICSourceEntry[]
setExcluded
(org.eclipse.core.runtime.IPath path, boolean isFolder, boolean excluded, ICSourceEntry[] entries, boolean throwExceptionOnErr) static ICSourceEntry[]
setExcludedIfPossible
(org.eclipse.core.runtime.IPath path, boolean isFolder, boolean excluded, ICSourceEntry[] entries) static void
setInteger
(ICStorageElement el, String attr, int value) static String[]
stringToArray
(String string, String separator)
-
Field Details
-
EMPTY_STRING_ARRAY
-
-
Constructor Details
-
CDataUtil
public CDataUtil()
-
-
Method Details
-
genRandomNumber
public static int genRandomNumber() -
genId
-
objectsEqual
Deprecated. -
arrayToString
-
arrayToString
-
stringToArray
-
resolveEntries
public static ICSettingEntry[] resolveEntries(ICSettingEntry[] entries, ICConfigurationDescription cfgDes) -
resolveEntries
public static ICLanguageSettingEntry[] resolveEntries(ICLanguageSettingEntry[] entries, ICConfigurationDescription cfgDes) -
resolveEntries
public static ICSourceEntry[] resolveEntries(ICSourceEntry[] entries, ICConfigurationDescription cfgDes) -
resolveEntries
public static ICOutputEntry[] resolveEntries(ICOutputEntry[] entries, ICConfigurationDescription cfgDes) -
getPooledEntry
Return entry cached in setting entries pool to optimize for memory usage. Note that the pool will handle garbage collection for unreferenced entries.- Since:
- 5.4
-
createEntry
public static ICLanguageSettingEntry createEntry(ICLanguageSettingEntry entry, int flagsToAdd, int flafsToClear) Convenience method to cloneICLanguageSettingEntry
with modified flags. Note that this method keeps the entries in the pool to avoid proliferation of duplicates.- Parameters:
entry
- - source entry.flagsToAdd
- - binary combination of bits to add to the flags.flafsToClear
- - binary combination of bits to clear in the flags.- Returns:
- new entry with the modified flags.
-
createEntry
Convenience method to cloneICLanguageSettingEntry
with different flags. Note that this method keeps the entries in the pool to avoid proliferation of duplicates.- Parameters:
entry
- - source entry.flags
- - new flags.- Returns:
- new entry with the specified flags.
-
createEntry
public static ICSettingEntry createEntry(int kind, String name, String value, org.eclipse.core.runtime.IPath[] exclusionPatterns, int flags) Convenience method to createICSettingEntry
depending on kind. Note that this method keeps the entries in the pool to avoid proliferation of duplicates. -
createEntry
public static ICSettingEntry createEntry(int kind, String name, String value, org.eclipse.core.runtime.IPath[] exclusionPatterns, int flags, org.eclipse.core.runtime.IPath sourceAttachmentPath, org.eclipse.core.runtime.IPath sourceAttachmentRootPath, org.eclipse.core.runtime.IPath sourceAttachmentPrefixMapping) Convenience method to createICSettingEntry
depending on kind. Note that this method keeps the entries in the pool to avoid proliferation of duplicates. -
createCIncludePathEntry
Utility method to createCIncludePathEntry
. Note that this method keeps the entries in the pool to avoid proliferation of duplicates.- Since:
- 5.4
-
createCIncludeFileEntry
Utility method to createCIncludeFileEntry
. Note that this method keeps the entries in the pool to avoid proliferation of duplicates.- Since:
- 5.4
-
createCMacroEntry
Utility method to createCMacroEntry
. Note that this method keeps the entries in the pool to avoid proliferation of duplicates.- Since:
- 5.4
-
createCMacroFileEntry
Utility method to createCMacroFileEntry
. Note that this method keeps the entries in the pool to avoid proliferation of duplicates.- Since:
- 5.4
-
createCLibraryPathEntry
Utility method to createCLibraryPathEntry
. Note that this method keeps the entries in the pool to avoid proliferation of duplicates.- Since:
- 5.4
-
createCLibraryFileEntry
Utility method to createCLibraryFileEntry
. Note that this method keeps the entries in the pool to avoid proliferation of duplicates.- Since:
- 5.4
-
getSourceExtensions
public static String[] getSourceExtensions(org.eclipse.core.resources.IProject project, CLanguageData data) -
getExtensionsFromContentTypes
-
getContentTypeFileSpecs
public static String[] getContentTypeFileSpecs(org.eclipse.core.resources.IProject project, org.eclipse.core.runtime.content.IContentType type) -
findLanguagDataForFile
public static CLanguageData findLanguagDataForFile(String fileName, org.eclipse.core.resources.IProject project, CFolderData fData) -
findLanguagDataForFile
public static CLanguageData findLanguagDataForFile(String fileName, org.eclipse.core.resources.IProject project, CLanguageData[] datas) -
findLanguageDataForExtension
-
createPathRcDataMap
public static Map<org.eclipse.core.runtime.IPath,CResourceData> createPathRcDataMap(CConfigurationData data) -
createRcDataHolder
-
createEmptyData
public static CConfigurationData createEmptyData(String id, String name, CDataFactory factory, boolean performLangAdjustment) -
adjustConfig
-
isExcluded
-
isExcluded
-
isOnSourceEntry
-
canExclude
public static boolean canExclude(org.eclipse.core.runtime.IPath path, boolean isFolder, boolean excluded, ICSourceEntry[] entries) -
isEqual
- Parameters:
ein
- - initial source entriesaus
- - resulting source entries- Returns:
- - true if they are equal
-
setExcluded
public static ICSourceEntry[] setExcluded(org.eclipse.core.runtime.IPath path, boolean isFolder, boolean excluded, ICSourceEntry[] entries) throws org.eclipse.core.runtime.CoreException - Throws:
org.eclipse.core.runtime.CoreException
-
setExcludedIfPossible
public static ICSourceEntry[] setExcludedIfPossible(org.eclipse.core.runtime.IPath path, boolean isFolder, boolean excluded, ICSourceEntry[] entries) -
setExcluded
public static ICSourceEntry[] setExcluded(org.eclipse.core.runtime.IPath path, boolean isFolder, boolean excluded, ICSourceEntry[] entries, boolean throwExceptionOnErr) throws org.eclipse.core.runtime.CoreException - Throws:
org.eclipse.core.runtime.CoreException
-
adjustEntries
-
adjustEntries
public static ICOutputEntry[] adjustEntries(ICOutputEntry[] entries, boolean makeAbsolute, org.eclipse.core.resources.IProject project) -
adjustEntries
public static ICSourceEntry[] adjustEntries(ICSourceEntry[] entries, boolean makeAbsolute, org.eclipse.core.resources.IProject project) -
makeAbsolute
public static ICSourceEntry makeAbsolute(org.eclipse.core.resources.IProject project, ICSourceEntry entry) -
makeRelative
public static ICSourceEntry makeRelative(org.eclipse.core.resources.IProject project, ICSourceEntry entry) -
makeRelative
public static ICSourceEntry[] makeRelative(org.eclipse.core.resources.IProject project, ICSourceEntry[] entries) -
makeAbsolute
public static ICSourceEntry[] makeAbsolute(org.eclipse.core.resources.IProject project, ICSourceEntry[] entries) -
makeAbsolute
public static ICOutputEntry makeAbsolute(org.eclipse.core.resources.IProject project, ICOutputEntry entry) -
makeRelative
public static ICOutputEntry makeRelative(org.eclipse.core.resources.IProject project, ICOutputEntry entry) -
makeAbsolute
public static ICOutputEntry[] makeAbsolute(org.eclipse.core.resources.IProject project, ICOutputEntry[] entries) -
makeRelative
public static ICOutputEntry[] makeRelative(org.eclipse.core.resources.IProject project, ICOutputEntry[] entries) -
addExcludePaths
public static ICSourceEntry addExcludePaths(ICSourceEntry entry, Collection<org.eclipse.core.runtime.IPath> paths, boolean removePrefix) -
fillEntriesMapByNameKey
public static Map<EntryNameKey,ICSettingEntry> fillEntriesMapByNameKey(Map<EntryNameKey, ICSettingEntry> map, ICSettingEntry[] entries) -
fillEntriesMapByContentsKey
public static Map<EntryContentsKey,ICSettingEntry> fillEntriesMapByContentsKey(Map<EntryContentsKey, ICSettingEntry> map, ICSettingEntry[] entries) -
getBoolean
-
setBoolean
-
getInteger
-
setInteger
-
addRemoveExclusionsToEntry
public static ICExclusionPatternPathEntry addRemoveExclusionsToEntry(ICExclusionPatternPathEntry entry, org.eclipse.core.runtime.IPath[] paths, boolean add) throws IllegalArgumentException - Throws:
IllegalArgumentException
-
makeAbsolute
public static ICExclusionPatternPathEntry makeAbsolute(org.eclipse.core.resources.IProject project, ICExclusionPatternPathEntry entry, boolean force) -
makeRelative
public static ICExclusionPatternPathEntry makeRelative(org.eclipse.core.resources.IProject project, ICExclusionPatternPathEntry entry, boolean force) -
makeRelative
public static ICExclusionPatternPathEntry[] makeRelative(org.eclipse.core.resources.IProject project, ICExclusionPatternPathEntry[] entries, boolean force) -
makeAbsolute
public static ICExclusionPatternPathEntry[] makeAbsolute(org.eclipse.core.resources.IProject project, ICExclusionPatternPathEntry[] entries, boolean force)
-
Object.equals(Object)