Example #1
0
NITFAPI(NITF_BOOL) nitf_Field_get(nitf_Field * field,
                                  NITF_DATA * outValue,
                                  nitf_ConvType convType,
                                  size_t length, nitf_Error * error)
{
    NITF_BOOL status = NITF_FAILURE;
    switch (convType)
    {
        case NITF_CONV_UINT:
            status = toUint(field, outValue, length, error);
            break;

        case NITF_CONV_INT:
            status = toInt(field, outValue, length, error);
            break;

        case NITF_CONV_STRING:
            status = toString(field, (char *) outValue, length, error);
            break;

        case NITF_CONV_RAW:
            status = toRaw(field, (char *) outValue, length, error);
            break;

        case NITF_CONV_REAL:
            status = toReal(field, outValue, length, error);
            break;
    }
    return status;
}
Example #2
0
SystemExclusive::SystemExclusive(const Event &e)
{
    if (e.getType() != EventType) {
        throw Event::BadType("SystemExclusive model event", EventType, e.getType());
    }
    std::string datablock;
    e.get<String>(DATABLOCK, datablock);
    m_rawData = toRaw(datablock);
}
Example #3
0
bool
SystemExclusive::isHex(std::string rh)
{
    // arf
    try {
	std::string r = toRaw(rh);
    } catch (BadEncoding) {
	return false;
    }
    return true;
}
    QString toRaw(FastoCommonItem* item)
    {
        if(!item){
            return QString();
        }

        if(!item->childrenCount()){
            return item->value();
        }

        QString value;
        for(int i = 0; i < item->childrenCount(); ++i){
            value += toRaw(dynamic_cast<FastoCommonItem*>(item->child(i)));
        }

        return value;
    }
QByteArray Bencode::toRaw() const
{
    return toRaw(this);
}