#pragma once #ifndef READNAMES_H #define SHARED_LIB_H #include #include /// /// Use this delegate type to define a callback function for processing names read from a file. /// /// FNameRead /// A function pointer type for a callback that processes names read from a file. /// The first name read from the file. /// The last name read from the file. /// Returns true to continue reading names, or false to stop. typedef bool (*FNameRead)(const std::string& firstName, const std::string& lastName); /// /// Use this function to read names from a specified file and process them using a callback function. /// /// readNamesFromFile /// Reads names from a specified file and invokes a callback for each name read. /// The path to the file containing names. /// A callback function that is called for each name read. It takes two parameters: firstName and lastName. If the callback returns false, the reading process stops. /// The first name read from the file. /// The last name read from the file. /// None. void readNamesFromFile(const std::string& aFilename, FNameRead aOnNameRead); #endif // READNAMES_H