Ejemplo n.º 1
0
void VaultAgeInfoNode::CopyFrom (const plAgeInfoStruct * info) {
    wchar_t str[MAX_PATH];

    // age filename
    if (info->HasAgeFilename()) {
        StrToUnicode(str, info->GetAgeFilename(), arrsize(str));
        SetAgeFilename(str);
    }
    else {
        SetAgeFilename(nil);
    }

    // age instance name
    if (info->HasAgeInstanceName()) {
        StrToUnicode(str, info->GetAgeInstanceName(), arrsize(str));
        SetAgeInstanceName(str);
    }
    else {
        SetAgeInstanceName(nil);
    }
    
    // age user-defined name
    if (info->HasAgeUserDefinedName())  {
        StrToUnicode(str, info->GetAgeUserDefinedName(), arrsize(str));
        SetAgeUserDefinedName(str);
    }
    else {
        SetAgeUserDefinedName(nil);
    }

    // age description
    // TODO
    if (info->HasAgeDescription())  {
//      StrToUnicode(str, info->GetAgeDescription(), arrsize(str));
//      SetAgeDescription(str);
    }
    else {
//      SetAgeDescription(nil);
    }

    // age sequence number
    SetAgeSequenceNumber(info->GetAgeSequenceNumber());

    // age instance guid
    SetAgeInstanceGuid(*info->GetAgeInstanceGuid());

    // age language
    SetAgeLanguage(info->GetAgeLanguage());
}
//============================================================================
void plAgeInfoStruct::CopyFrom(const NetAgeInfo & info) {
    char tmp[MAX_PATH];

    // Filename 
    StrToAnsi(tmp, info.ageFilename, arrsize(tmp));
    SetAgeFilename(tmp);
    // InstanceName 
    StrToAnsi(tmp, info.ageInstName, arrsize(tmp));
    SetAgeInstanceName(tmp);
    // UserDefinedName  
    StrToAnsi(tmp, info.ageUserName, arrsize(tmp));
    SetAgeUserDefinedName(tmp);
    // Description  
    StrToAnsi(tmp, info.ageDesc, arrsize(tmp));
    SetAgeDescription(tmp);

    plUUID inst(info.ageInstId);
    SetAgeInstanceGuid(&inst);
    SetAgeSequenceNumber(info.ageSequenceNumber);
    SetAgeLanguage(info.ageLanguage);
}