Пример #1
0
void CFileItem::SaveItem(pugi::xml_node& element) const
{
    if (m_edit != CEditHandler::none || !element) {
        return;
    }

    auto file = element.append_child("File");

    AddTextElement(file, "LocalFile", m_localPath.GetPath() + GetLocalFile());
    AddTextElement(file, "RemoteFile", GetRemoteFile());
    AddTextElement(file, "RemotePath", m_remotePath.GetSafePath());
    AddTextElementUtf8(file, "Download", Download() ? "1" : "0");
    if (m_size != -1) {
        AddTextElement(file, "Size", m_size);
    }
    if (m_errorCount) {
        AddTextElement(file, "ErrorCount", m_errorCount);
    }
    if (m_priority != QueuePriority::normal) {
        AddTextElement(file, "Priority", static_cast<int>(m_priority));
    }
    AddTextElementUtf8(file, "DataType", Ascii() ? "0" : "1");
    if (m_defaultFileExistsAction != CFileExistsNotification::unknown) {
        AddTextElement(file, "OverwriteAction", m_defaultFileExistsAction);
    }
}
Пример #2
0
void CFolderItem::SaveItem(pugi::xml_node& element) const
{
    auto file = element.append_child("Folder");

    if (Download()) {
        AddTextElement(file, "LocalFile", GetLocalPath().GetPath() + GetLocalFile());
    }
    else {
        AddTextElement(file, "RemoteFile", GetRemoteFile());
        AddTextElement(file, "RemotePath", m_remotePath.GetSafePath());
    }
    AddTextElementUtf8(file, "Download", Download() ? "1" : "0");
}
Пример #3
0
void CFolderItem::SaveItem(TiXmlElement* pElement) const
{
	TiXmlElement *file = new TiXmlElement("Folder");

	if (Download())
		AddTextElement(file, "LocalFile", GetLocalPath().GetPath() + GetLocalFile());
	else
	{
		AddTextElement(file, "RemoteFile", GetRemoteFile());
		AddTextElement(file, "RemotePath", m_remotePath.GetSafePath());
	}
	AddTextElementRaw(file, "Download", Download() ? "1" : "0");

	pElement->LinkEndChild(file);
}
Пример #4
0
void CFileItem::SaveItem(TiXmlElement* pElement) const
{
	if (m_edit != CEditHandler::none)
		return;

	TiXmlElement *file = pElement->LinkEndChild(new TiXmlElement("File"))->ToElement();

	AddTextElement(file, "LocalFile", m_localPath.GetPath() + GetLocalFile());
	AddTextElement(file, "RemoteFile", GetRemoteFile());
	AddTextElement(file, "RemotePath", m_remotePath.GetSafePath());
	AddTextElementRaw(file, "Download", Download() ? "1" : "0");
	if (m_size != -1)
		AddTextElement(file, "Size", m_size.ToString());
	if (m_errorCount)
		AddTextElement(file, "ErrorCount", m_errorCount);
	if (m_priority != QueuePriority::normal)
		AddTextElement(file, "Priority", static_cast<int>(m_priority));
	AddTextElementRaw(file, "DataType", m_transferSettings.binary ? "1" : "0");
	if (m_defaultFileExistsAction != CFileExistsNotification::unknown)
		AddTextElement(file, "OverwriteAction", m_defaultFileExistsAction);
}