KeyView 23.2

# Detect the Format of a File

You can detect the format of a file by using the `detect` method. For example:

    auto myinput = keyview::io::InputFile{ std::string("InputFile.docx") };
    auto detection_info = KV.detect(myinput);

    // Print out what we found
    std::cout << "Format:\t" << static_cast<int>(detection_info.format()) << "\n";
    std::cout << "Description:\t" << detection_info.description() << "\n";
    std::cout << "Version:\t" << detection_info.version() << "\n";
    std::cout << "Category:\t" << static_cast<int>(detection_info.category()) << "\n";
    std::cout << "Category Name:\t" << detection_info.category_name() << "\n";
    std::cout << "Encrypted:\t" << std::boolalpha << detection_info.encrypted() << "\n";

Copyright 2016-2023 Open Text
Version 23.2 | Last updated March 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.2

Topic Title: Detect the Format of a File