Exemplo n.º 1
0
void VaultAgeInfoNode::CopyTo (plAgeInfoStruct * info) const {
    char str[MAX_PATH];

    // age filename
    StrToAnsi(str, GetAgeFilename(), arrsize(str));
    info->SetAgeFilename(str);

    // age instance name
    StrToAnsi(str, GetAgeInstanceName(), arrsize(str));
    info->SetAgeInstanceName(str);

    // age user-defined name
    StrToAnsi(str, GetAgeUserDefinedName(), arrsize(str));
    info->SetAgeUserDefinedName(str);

    // age description
    // TODO

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

    // age instance guid
    plUUID uuid(GetAgeInstanceGuid());
    info->SetAgeInstanceGuid(&uuid);

    // age language
    info->SetAgeLanguage(GetAgeLanguage());
}
const char * plAgeInfoStruct::GetDisplayName() const
{
    int seq = GetAgeSequenceNumber();
    if ( seq>0 )
        xtl::format( fDisplayName, "%s(%d) %s", GetAgeUserDefinedName(), seq, GetAgeInstanceName() );
    else
        xtl::format( fDisplayName, "%s %s", GetAgeUserDefinedName(), GetAgeInstanceName() );
    return fDisplayName.c_str();
}
Exemplo n.º 3
0
plString pyAgeInfoStructRef::GetDisplayName() const
{
    plString instance = GetAgeInstanceName();
    plString user = GetAgeUserDefinedName();
    bool namesEqual = (user.CompareI(instance) == 0); // Ae'gura Ae'gura

    if (namesEqual)
        return instance;
    else
    {
        int32_t seq = GetAgeSequenceNumber();
        if (seq > 0)
            return plFormat("{} ({}) {}", user, seq, instance);
        else
            return plFormat("{} {}", user, instance);
    }
}
//============================================================================
plString plAgeInfoStruct::AsString() const
{
    const char * spacer = kEmpty;

    plStringStream ss;

    ss << "[";

    if (HasAgeFilename())
    {
        ss  << spacer
            << "FName:"
            << SAFE(GetAgeFilename());
        spacer = kComma;
    }
    if (HasAgeInstanceName())
    {
        ss  << spacer
            << "IName:"
            << SAFE(GetAgeInstanceName());
        spacer = kComma;
    }
    if (HasAgeInstanceGuid())
    {
        ss  << spacer
            << "Guid:"
            << fAgeInstanceGuid.AsString();
        spacer = kComma;
    }
    if (HasAgeUserDefinedName())
    {
        ss  << spacer
            << "UName:"
            << SAFE(GetAgeUserDefinedName());
        spacer = kComma;
    }
    if (HasAgeSequenceNumber())
    {
        ss  << spacer
            << "Seq:"
            << GetAgeSequenceNumber();
        spacer = kComma;
    }
    if (HasAgeDescription())
    {
        ss  << spacer
            << "Desc:"
            << SAFE(GetAgeDescription());
        spacer = kComma;
    }
    if (HasAgeLanguage())
    {
        ss  << spacer
            << "Lang:"
            << GetAgeLanguage();
        spacer = kComma;
    }
    ss  << "]";

    return ss.GetString();
}