AFEBL/ 0000755 0001750 0001750 00000000000 11124766537 011235 5 ustar alvaro alvaro AFEBL/afeblcontainer.cpp 0000644 0001750 0001750 00000004533 11125167554 014715 0 ustar alvaro alvaro /***************************************************************************
* Copyright (C) 2008 by Alvaro Garcia *
* maxpowel@gmail.com *
* *
* This file is part of AFEBL *
* *
* AFBL is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with Foobar. If not, see . *
***************************************************************************/
#include "afeblcontainer.h"
AFEBLcontainer::AFEBLcontainer()
{
}
AFEBLcontainer::~AFEBLcontainer()
{
}
void AFEBLcontainer::add(string inputName,string inputValue)
{
this->elements[inputName]=inputValue;
}
bool AFEBLcontainer::remove(string inputName)
{
if(this->elements.find(inputName)!=this->elements.end())
{
this->elements.erase(inputName);
return true;
}
else return false;
}
void AFEBLcontainer::clear()
{
this->elements.clear();
}
string AFEBLcontainer::get(string inputName)
{
this->element=this->elements.find(inputName);
if(this->element!=this->elements.end())
return this->element->second;
else
return "";
}
bool AFEBLcontainer::modify(string inputName,string newValue)
{
this->element=this->elements.find(inputName);
if(this->element!=this->elements.end())
{
this->add(inputName,newValue);
return true;
}
else
return false;
}
void AFEBLcontainer::show()
{
for(this->element=this->elements.begin();this->element!=this->elements.end();this->element++)
{
cout << this->element->first <<": "<element->second<<"\n";
}
}
AFEBL/afeblipresolver.h 0000644 0001750 0001750 00000003163 11125167554 014570 0 ustar alvaro alvaro /***************************************************************************
* Copyright (C) 2008 by Alvaro Garcia *
* maxpowel@gmail.com *
* *
* This file is part of AFEBL *
* *
* AFBL is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with Foobar. If not, see . *
***************************************************************************/
#ifndef AFEBLIPRESOLVER_H
#define AFEBLIPRESOLVER_H
#include
#include
#include
#include
#include
/**
@author Alvaro Garcia
*/
class AFEBLipResolver{
AFEBLipResolver();
public:
static struct sockaddr_in getIpFrom(string host);
};
#endif
AFEBL/afeblpostdata.cpp 0000644 0001750 0001750 00000003543 11125167554 014552 0 ustar alvaro alvaro /***************************************************************************
* Copyright (C) 2008 by Alvaro Garcia *
* maxpowel@gmail.com *
* *
* This file is part of AFEBL *
* *
* AFBL is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with Foobar. If not, see . *
***************************************************************************/
#include "afeblpostdata.h"
#include
AFEBLpostData::AFEBLpostData()
{
}
AFEBLpostData::~AFEBLpostData()
{
}
string AFEBLpostData::build()
{
//this->show();
string data;
stringstream size;
for(this->element=this->elements.begin();this->element!=this->elements.end();this->element++)
{
data+=this->element->first +"="+this->element->second+"&";
}
if(data.length()>0)
{
data.resize(data.length()-1);
size<