---
name: "sc_ParsedKeyVal"
section: "3"
platform: "linux"
package: "libsc-doc"
version: "2.3.1-22"
release: "Debian 12 (Bookworm)"
platforms: ["linux"]
url: "https://new.carta.tech/sc_ParsedKeyVal"
---

# sc\_ParsedKeyVal(3)

Converts textual information into keyword/value assocations.

## NAME

sc::ParsedKeyVal - Converts textual information into keyword/value assocations.

## SYNOPSIS

`#include <keyval.h>`

Inherits **sc::StringKeyVal**.

### Public Member Functions

**ParsedKeyVal** ()\
 Create an empty **ParsedKeyVal**.  **ParsedKeyVal** (const char \*file)\
 Parse the given input file.  **ParsedKeyVal** (std::istream &s)\
 Read input from s.  **ParsedKeyVal** (**IPV2** \*)\
 Use the given IPV2\* object.  **ParsedKeyVal** (const char \*, const **Ref**\< **KeyVal** \> &)\
 This ctor is given a string which is used to form keywords that are sought in the keyval argument.  **~ParsedKeyVal** ()\
 Cleanup, deleting the **IPV2** object.  void **read** (const char \*)\
 Read input data from the given filename.  void **read** (std::istream &)\
 Read input data from the given stream.  void **parse\_string** (const char \*)\
 Read input data from the given string.

**Overrides of parent members.**\
 See parent class documentation.

const char \* **stringrep** (const char \*)\
 Returns the string representation of the value assigned to key.  const char \* **classname** (const char \*)\
 Returns the name of the exact class of the object at the keyword.  const char \* **truekeyword** (const char \*)\
 Returns a string which is the actual keyword if some sort of variable substitution takes place (needed to make multiple references to the same object work in input files).  void **errortrace** (std::ostream &fp=**ExEnv::err0**())\
 Write a message to fp describing the error.  void **dump** (std::ostream &fp=**ExEnv::err0**())\
 Write a message to fp describing the error.  void **print\_unseen** (std::ostream &fp=**ExEnv::out0**())\
 Print keywords that were never looked at, if possible.  int **have\_unseen** ()\
 Return 1 if there were unseen keywords, 0 if there are none, or -1 this keyval doesn't keep track of unseen keywords.

### Static Public Member Functions

static void **cat\_files** (const char \*, const **Ref**\< **KeyVal** \> &, std::ostream &o)\
 This is like the **ParsedKeyVal(const char\*,const Ref\<KeyVal\>&)** ctor, but writes the contents of the files to the given ostream.

### Additional Inherited Members

## Detailed Description

Converts textual information into keyword/value assocations.

The parsing is done with an **IPV2** object. The **keyval** for more information on the input format. \

## Constructor & Destructor Documentation

### sc::ParsedKeyVal::ParsedKeyVal (IPV2 \*)

Use the given IPV2\* object. The new **ParsedKeyVal** takes wnership of the passed **IPV2** object.

### sc::ParsedKeyVal::ParsedKeyVal (const char \*, const Ref\< KeyVal \> &)

This ctor is given a string which is used to form keywords that are sought in the keyval argument. The associated values are used to construct file names that are used to initialize the **ParsedKeyVal**. The keywords sought are string'dir' for the directory prefix and string'files' for an array of file names.

## Member Function Documentation

### const char \* sc::ParsedKeyVal::classname (const char \*)` [virtual]`

Returns the name of the exact class of the object at the keyword. If no classname is assigned then 0 is returned.

Reimplemented from **sc::StringKeyVal**.

### void sc::ParsedKeyVal::dump (std::ostream & fp = ExEnv::err0`()`)` [virtual]`

Write a message to fp describing the error.

Reimplemented from **sc::StringKeyVal**.

### void sc::ParsedKeyVal::errortrace (std::ostream & fp = ExEnv::err0`()`)` [virtual]`

Write a message to fp describing the error.

Reimplemented from **sc::StringKeyVal**.

### int sc::ParsedKeyVal::have\_unseen ()` [virtual]`

Return 1 if there were unseen keywords, 0 if there are none, or -1 this keyval doesn't keep track of unseen keywords.

Reimplemented from **sc::KeyVal**.

### void sc::ParsedKeyVal::print\_unseen (std::ostream & fp = ExEnv::out0`()`)` [virtual]`

Print keywords that were never looked at, if possible.

Reimplemented from **sc::KeyVal**.

### const char \* sc::ParsedKeyVal::stringrep (const char \* key)` [virtual]`

Returns the string representation of the value assigned to key.

Implements **sc::StringKeyVal**.

### const char \* sc::ParsedKeyVal::truekeyword (const char \*)` [virtual]`

Returns a string which is the actual keyword if some sort of variable substitution takes place (needed to make multiple references to the same object work in input files).

Reimplemented from **sc::StringKeyVal**.

## Author

Generated automatically by Doxygen for MPQC from the source code.
