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: -
Data. Sets or gets the summary element's content.If
typeisKV_Int4orKV_Bool, thendatacontains the actual value. Otherwise,Datais a pointer to the actual value.KV_IEEE8point to an 8-byte value.KV_DateTime,KV_StringandKV_Unicodepoint to the beginning of the string that contains the text.KV_Unicodeis replaced withKV_Stringwhen 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
SumInfoTypeisKV_DateTime, the value in theDataByteArrayis 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.