Exemple #1
0
	virtual void readable() override {
		doc.reset();
		
		this->read(doc);
		
		f.parse(doc);
		timeout();
	}
Exemple #2
0
void Device::create_readings_xml(pugi::xml_document &doc, int n_readings)
{
        doc.reset();
        
        // client base node
        pugi::xml_node node = doc.append_child("client");
        
        xml_header(doc);
        xml_readings(doc, false, n_readings);
}
Exemple #3
0
void Device::create_confirm_xml(pugi::xml_document &doc, int n_readings)
{
        doc.reset();
        
        // client base node
        pugi::xml_node node = doc.append_child("server");
        
        xml_header(doc);
        xml_latest_readings(doc, true, n_readings);
}
/// @brief Select the input file from the Repository
/// @param the file name (including path) of the IDoc to use as input for any IDoc parameters
/// @return true if the file exists and was selected successfully
IDOCREPLAYDLL_API BOOL idoc_select_input_file(const LPCSTR filePath)
{
    g_idocParamInputFilePath.erase();
    g_idocParamInputFile.reset();

    if (!ensure_valid_license())
    {
        return FALSE;
    }

    if (filePath == NULL)
    {
        lr_error_message("[%s] File path cannot be NULL.", __FUNCTION__);
        return FALSE;
    }

    if (!Utils::FileExists(filePath))
    {
        lr_error_message("[%s] File \"%s\" is not found.", __FUNCTION__, filePath);
        return FALSE;
    }

    using namespace pugi;

    const xml_parse_result parseResult = g_idocParamInputFile.load_file(filePath);
    if (!parseResult)
    {
        lr_error_message("[%s] Invalid input file XML (%s).", __FUNCTION__, parseResult.description());
        return FALSE;
    }

    g_idocParamInputFilePath = filePath;
	if (is_trace_log_enabled())
    {
        lr_output_message("Selected IDoc input file: %s", filePath);
    }
    return TRUE;
}