Package de.marw.cmake.cmakecache
Class CMakeCacheFileParser
java.lang.Object
de.marw.cmake.cmakecache.CMakeCacheFileParser
A simple parser for CMake cache files (
CMakeCache.txt). This
implementation extracts only key-value-pairs corresponding to an entry. It
does not extract any help texts nor entry types.- Author:
- Martin Weber
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceA filter for CMake cache file entry keys. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanparse(Reader isr, CMakeCacheFileParser.EntryFilter filter, Collection<SimpleCMakeCacheEntry> parsedEntries, List<String> errorLog) Parses the content of the specified input stream as a CMake cache file content.
-
Constructor Details
-
CMakeCacheFileParser
public CMakeCacheFileParser()
-
-
Method Details
-
parse
public boolean parse(Reader isr, CMakeCacheFileParser.EntryFilter filter, Collection<SimpleCMakeCacheEntry> parsedEntries, List<String> errorLog) throws IOException Parses the content of the specified input stream as a CMake cache file content.
This implementation is inspired by cmCacheManager.cxx.- Parameters:
isr- the reader that serves the content of the CMake cache filefilter- an optional filter for CMake cache file entries ornullif all entries are of interestparsedEntries- receives the parsed cache file entries. Specifynull, if you want to verify the correct syntax of the cache file only. Specify an instance ofList, if you expect multiple cache entires of the same key int the file. Normally, you would specify an instance ofSethere.errorLog- receives messages concerning parse errors. Specifynull, if you are not interested in error messages.- Returns:
trueif the file could be parsed without errors, otherwisefalse- Throws:
IOException- if an operation on the input stream failed
-