Beispiel #1
0
Expr* Transform::post_expr(Expr* in)
{
    switch(in->classid())
    {
    case Param::ID: return post_param(dynamic_cast<Param*>(in));
    case STRING::ID: return post_string(dynamic_cast<STRING*>(in));
    case Lookup::ID: return post_lookup(dynamic_cast<Lookup*>(in));
    case Macro_call::ID: return post_macro_call(dynamic_cast<Macro_call*>(in));
    case Callback::ID: return post_callback(dynamic_cast<Callback*>(in));
    }
    assert(0);
}
Beispiel #2
0
/***********************************************************************//**
 * @brief Execute function on server
 *
 * @param[in] request XML request string
 * @return XML response
 ***************************************************************************/
GXml GVOClient::execute(const std::string& request) const
{
    // Initialise response
    GXml xml;

    // Connect to hub
    connect_to_hub();

    // Continue only if connection has been established
    if (m_socket != -1) {

        // Post request
        post_string(request);

        // Receive response
        std::string response = receive_string();

        // Find start of XML text
        size_t start = response.find("<?xml");

        // If found then convert text into XML document
        if (start != std::string::npos) {
            xml = GXml(response.substr(start, std::string::npos));
        }

        // Close socket
        if (m_socket != -1) {
            close(m_socket);
            m_socket = -1;
        }

    } // endif: connection has been established

    // Return response
    return xml;
}
Beispiel #3
0
static GHashTable *bodhi_query_list(const char *query, const char *release)
{
    char *bodhi_url_bugs = xasprintf("%s/list", bodhi_url);

    post_state_t *post_state = new_post_state(POST_WANT_BODY
                                              | POST_WANT_SSL_VERIFY
                                              | POST_WANT_ERROR_MSG);

    const char *headers[] = {
        "Accept: application/json",
        NULL
    };

    post_string(post_state, bodhi_url_bugs, "application/x-www-form-urlencoded",
                     headers, query);

    if (post_state->http_resp_code != 200)
    {
        char *errmsg = post_state->curl_error_msg;
        if (errmsg && errmsg[0])
            error_msg_and_die("%s '%s'", errmsg, bodhi_url_bugs);
    }
    free(bodhi_url_bugs);

//    log("%s", post_state->body);

    json_object *json = json_tokener_parse(post_state->body);
    if (is_error(json))
        error_msg_and_die("fatal: unable parse response from bodhi server");

    GHashTable *bodhi_table = bodhi_parse_json(json, release);
    json_object_put(json);
    free_post_state(post_state);

    return bodhi_table;
}
RPG_Common_CreatureSubType RPG_Common_CreatureSubType_Type::post_RPG_Common_CreatureSubType_Type()
{
  RPG_TRACE(ACE_TEXT("RPG_Common_CreatureSubType_Type::post_RPG_Common_CreatureSubType_Type"));

  return RPG_Common_CreatureSubTypeHelper::stringToRPG_Common_CreatureSubType(post_string());
}
RPG_Common_SaveReductionType RPG_Common_SaveReductionType_Type::post_RPG_Common_SaveReductionType_Type()
{
  RPG_TRACE(ACE_TEXT("RPG_Common_SaveReductionType_Type::post_RPG_Common_SaveReductionType_Type"));

  return RPG_Common_SaveReductionTypeHelper::stringToRPG_Common_SaveReductionType(post_string());
}
RPG_Common_SavingThrow RPG_Common_SavingThrow_Type::post_RPG_Common_SavingThrow_Type()
{
  RPG_TRACE(ACE_TEXT("RPG_Common_SavingThrow_Type::post_RPG_Common_SavingThrow_Type"));

  return RPG_Common_SavingThrowHelper::stringToRPG_Common_SavingThrow(post_string());
}
Beispiel #7
0
RPG_Item_WeaponClass RPG_Item_WeaponClass_Type::post_RPG_Item_WeaponClass_Type()
{
  RPG_TRACE(ACE_TEXT("RPG_Item_WeaponClass_Type::post_RPG_Item_WeaponClass_Type"));

  return RPG_Item_WeaponClassHelper::stringToRPG_Item_WeaponClass(post_string());
}
RPG_Common_Condition RPG_Common_Condition_Type::post_RPG_Common_Condition_Type()
{
  RPG_TRACE(ACE_TEXT("RPG_Common_Condition_Type::post_RPG_Common_Condition_Type"));

  return RPG_Common_ConditionHelper::stringToRPG_Common_Condition(post_string());
}
RPG_Common_AmbientLighting RPG_Common_AmbientLighting_Type::post_RPG_Common_AmbientLighting_Type()
{
  RPG_TRACE(ACE_TEXT("RPG_Common_AmbientLighting_Type::post_RPG_Common_AmbientLighting_Type"));

  return RPG_Common_AmbientLightingHelper::stringToRPG_Common_AmbientLighting(post_string());
}
Beispiel #10
0
RPG_Common_Track RPG_Common_Track_Type::post_RPG_Common_Track_Type()
{
  RPG_TRACE(ACE_TEXT("RPG_Common_Track_Type::post_RPG_Common_Track_Type"));

  return RPG_Common_TrackHelper::stringToRPG_Common_Track(post_string());
}
Beispiel #11
0
RPG_Item_ArmorType RPG_Item_ArmorType_Type::post_RPG_Item_ArmorType_Type()
{
  RPG_TRACE(ACE_TEXT("RPG_Item_ArmorType_Type::post_RPG_Item_ArmorType_Type"));

  return RPG_Item_ArmorTypeHelper::stringToRPG_Item_ArmorType(post_string());
}
Beispiel #12
0
RPG_Item_ArmorCategory RPG_Item_ArmorCategory_Type::post_RPG_Item_ArmorCategory_Type()
{
  RPG_TRACE(ACE_TEXT("RPG_Item_ArmorCategory_Type::post_RPG_Item_ArmorCategory_Type"));

  return RPG_Item_ArmorCategoryHelper::stringToRPG_Item_ArmorCategory(post_string());
}
Beispiel #13
0
RPG_Item_CommodityLight RPG_Item_CommodityLight_Type::post_RPG_Item_CommodityLight_Type()
{
  RPG_TRACE(ACE_TEXT("RPG_Item_CommodityLight_Type::post_RPG_Item_CommodityLight_Type"));

  return RPG_Item_CommodityLightHelper::stringToRPG_Item_CommodityLight(post_string());
}
Beispiel #14
0
RPG_Item_CommodityBeverage RPG_Item_CommodityBeverage_Type::post_RPG_Item_CommodityBeverage_Type()
{
  RPG_TRACE(ACE_TEXT("RPG_Item_CommodityBeverage_Type::post_RPG_Item_CommodityBeverage_Type"));

  return RPG_Item_CommodityBeverageHelper::stringToRPG_Item_CommodityBeverage(post_string());
}
Beispiel #15
0
RPG_Common_Camp RPG_Common_Camp_Type::post_RPG_Common_Camp_Type()
{
  RPG_TRACE(ACE_TEXT("RPG_Common_Camp_Type::post_RPG_Common_Camp_Type"));

  return RPG_Common_CampHelper::stringToRPG_Common_Camp(post_string());
}
Beispiel #16
0
RPG_Common_Terrain RPG_Common_Terrain_Type::post_RPG_Common_Terrain_Type()
{
  RPG_TRACE(ACE_TEXT("RPG_Common_Terrain_Type::post_RPG_Common_Terrain_Type"));

  return RPG_Common_TerrainHelper::stringToRPG_Common_Terrain(post_string());
}
Beispiel #17
0
RPG_Common_Skill RPG_Common_Skill_Type::post_RPG_Common_Skill_Type()
{
  RPG_TRACE(ACE_TEXT("RPG_Common_Skill_Type::post_RPG_Common_Skill_Type"));

  return RPG_Common_SkillHelper::stringToRPG_Common_Skill(post_string());
}
Beispiel #18
0
RPG_Common_TimeOfDay RPG_Common_TimeOfDay_Type::post_RPG_Common_TimeOfDay_Type()
{
  RPG_TRACE(ACE_TEXT("RPG_Common_TimeOfDay_Type::post_RPG_Common_TimeOfDay_Type"));

  return RPG_Common_TimeOfDayHelper::stringToRPG_Common_TimeOfDay(post_string());
}
Beispiel #19
0
RPG_Common_PhysicalDamageType RPG_Common_PhysicalDamageType_Type::post_RPG_Common_PhysicalDamageType_Type()
{
  RPG_TRACE(ACE_TEXT("RPG_Common_PhysicalDamageType_Type::post_RPG_Common_PhysicalDamageType_Type"));

  return RPG_Common_PhysicalDamageTypeHelper::stringToRPG_Common_PhysicalDamageType(post_string());
}
Beispiel #20
0
RPG_Common_SubClass RPG_Common_SubClass_Type::post_RPG_Common_SubClass_Type()
{
  RPG_TRACE(ACE_TEXT("RPG_Common_SubClass_Type::post_RPG_Common_SubClass_Type"));

  return RPG_Common_SubClassHelper::stringToRPG_Common_SubClass(post_string());
}
Beispiel #21
0
RPG_Common_AreaOfEffect RPG_Common_AreaOfEffect_Type::post_RPG_Common_AreaOfEffect_Type()
{
  RPG_TRACE(ACE_TEXT("RPG_Common_AreaOfEffect_Type::post_RPG_Common_AreaOfEffect_Type"));

  return RPG_Common_AreaOfEffectHelper::stringToRPG_Common_AreaOfEffect(post_string());
}
Beispiel #22
0
RPG_Common_Size RPG_Common_Size_Type::post_RPG_Common_Size_Type()
{
  RPG_TRACE(ACE_TEXT("RPG_Common_Size_Type::post_RPG_Common_Size_Type"));

  return RPG_Common_SizeHelper::stringToRPG_Common_Size(post_string());
}
Beispiel #23
0
RPG_Common_CounterMeasure RPG_Common_CounterMeasure_Type::post_RPG_Common_CounterMeasure_Type()
{
  RPG_TRACE(ACE_TEXT("RPG_Common_CounterMeasure_Type::post_RPG_Common_CounterMeasure_Type"));

  return RPG_Common_CounterMeasureHelper::stringToRPG_Common_CounterMeasure(post_string());
}