Options
All
  • Public
  • Public/Protected
  • All
Menu

Class CMakeCache

Reads a CMake cache file. This class is immutable.

Hierarchy

  • CMakeCache

Index

Constructors

Private constructor

  • new CMakeCache(_path: string, _exists: boolean, _entries: Map<string, Entry>): CMakeCache
  • Create a new instance. This is private. You may only create an instance via the fromPath static method.

    Parameters

    • _path: string

      Path to the cache

    • _exists: boolean

      Whether the file exists

    • _entries: Map<string, Entry>

      Entries in the cache

    Returns CMakeCache

Properties

Private _entries

_entries: Map<string, Entry>

Entries in the cache

Private _exists

_exists: boolean

Whether the file exists

Private _path

_path: string

Path to the cache

Accessors

allEntries

  • get allEntries(): Entry[]

exists

  • get exists(): boolean
  • true if the file exists when this instance was created. false otherwise.

    Returns boolean

path

  • get path(): string
  • The path to the cache file, which may not exist

    Returns string

Methods

get

  • get(key: string): Entry | null
  • Get an entry from the cache

    Parameters

    • key: string

      The name of a cache entry

    Returns Entry | null

    The cache entry, or null if the cache entry is not present.

getReloaded

  • Reload the cache file and return a new instance. This will not modify this instance.

    Returns Promise<CMakeCache>

    A new instance.

Static fromPath

  • Read the contents of a CMakeCache.txt file.

    note

    The cache may not exist. In that case, the entries is empty and the exists property is false. Creating or modifying the file named by path has no effect on existing instance of this class.

    Parameters

    • path: string

      Path to a CMakeCache.txt-format file

    Returns Promise<CMakeCache>

    The CMake cache.

Static parseCache

  • parseCache(content: string): Map<string, Entry>
  • Parse the contents of a CMake cache file.

    Parameters

    • content: string

      The contents of a CMake cache file.

    Returns Map<string, Entry>

    A map from the cache keys to the entries in the cache.

Generated using TypeDoc