KeyView 23.4

# Example

Below is an example of a call to `GetSummaryInfo()`:

If the get summary flag `-i` is set:

    List<SummaryInfoElement> sinfo sinfo = objFilter.GetSummaryInfo();
    if(sinfo != null)
    {
       FileStream fs = new FileStream(m_summaryFile, FileMode.OpenOrCreate, FileAccess.Write);
       StreamWriter sw = new StreamWriter(fs);
       //In case the ANSI is not 1252, using following to get byte array and then convert to correct information.
       // BinaryWriter bw = new BinaryWriter(fs);
       string charSet = objFilter.TargetCharSet;
       foreach (SummaryInfoElement item in sinfo)
    {
      Console.WriteLine( item.ElementName + ". data: " + item.Data );
      if (item.ElementName != null)
      {
        //bw.Write(item.ElementNameByteArray);
        sw.WriteLine(" name: " + item.ElementName );
      }
      if (item.Data != null)
      {
        //bw.Write(item.DataByteArray);
        sw.WriteLine(" data: " + item.Data );
      }
      sw.Flush();
      }
      sw.Close();
      fs.Close();
    }
    sinfo=null;

The `SummaryInfo` class stores the metadata extraction results. After calling the `Filter.GetSummaryInfo()`method, call the properties provided by each instance of this class to extract metadata. The following describes each property:

- `Isvalid`. Specifies whether the element data is present.

- `SumInfoType`. Sets or gets the summary element's data type. The possible types are:

  `KV_String` | The value in the metadata field is a string.
  `KV_Int4` | The value in the metadata field is an integer.
  `KV_DateTime` | The value in the metadata field is a date and time.
  `KV_ClipBoard` | Currently not supported.
  `KV_Bool` | The value in the metadata field is a boolean.
  `KV_Unicode` | The value in the metadata field is a Unicode string.
  `KV_IEEE8` | The value in the metadata field is an IEEE 8-byte integer.
  `KV_Other` | The value in the metadata field is user-defined.

- `Data`. Sets or gets the summary element's content.

  If `type` is `KV_Int4` or `KV_Bool`, then `data` contains the actual value. Otherwise, `Data` is a pointer to the actual value.

  `KV_IEEE8` point to an 8-byte value.

  `KV_DateTime` , `KV_String` and `KV_Unicode` point to the beginning of the string that contains the text. `KV_Unicode` is replaced with `KV_String` when the UNICODE value has been character mapped to the desired output character set.

- `ElementName`. Sets or gets the summary element's name.
- `ElementNameByteArray`. Sets or gets the summary element's name using a byte array in case the character set is not known.

- `DataByteArray`. Gets the summary element's content using a byte array.

  If the `SumInfoType` is `KV_DateTime` , the value in the `DataByteArray` is a 64-bit value representing the number of 100-nanosecond intervals since January 1, 1601 (Windows FILETIME EPOCH). You might need to convert this value into another format.

Copyright 2016-2023 Open Text
Version 23.4 | Last updated September 2023

Send documentation feedback

Close

Send documentation feedback

To send feedback using your default email client, open an email window.

Otherwise, send your feedback and the information below to swpdl.idoldocsfeedback@microfocus.com.

We appreciate your feedback!

Product: IDOL KeyView 23.4

Topic Title: Example