Class CMakeCacheFileParser

java.lang.Object
de.marw.cmake.cmakecache.CMakeCacheFileParser

public class CMakeCacheFileParser extends Object
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
  • 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 file
      filter - an optional filter for CMake cache file entries or null if all entries are of interest
      parsedEntries - receives the parsed cache file entries. Specify null, if you want to verify the correct syntax of the cache file only. Specify an instance of List, if you expect multiple cache entires of the same key int the file. Normally, you would specify an instance of Set here.
      errorLog - receives messages concerning parse errors. Specify null, if you are not interested in error messages.
      Returns:
      true if the file could be parsed without errors, otherwise false
      Throws:
      IOException - if an operation on the input stream failed