#include "Uri.h"
#include "utils.h"
#include <cassert>
#include <iostream>
#include <locale>
#include <string>
#include <vector>
#include <boost/algorithm/string.hpp>
#include <boost/array.hpp>
#include <boost/assign.hpp>
#include <boost/filesystem.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/tokenizer.hpp>
#include <boost/xpressive/xpressive_static.hpp>
Veure el codi d'aquest fitxer.
Funcions |
bool | es_parseable (const string &s) |
| Comprova si una cadena es pot analitzar correctament com a URL.
|
template<typename S , typename I > |
S | join_r (const I &beg, const I &end, const S &sep) |
ostream & | operator<< (ostream &os, const Uri &u) |
string | reconstrueix (const string &esquema, const string &autoritat, const string &ruta, const string ¶ms, const string &query, const string &fragment) |
string | reconstrueix (const Uri &u) |
| Reconstrucció del text d'una URL a partir dels seus components.
|
Variables |
const sregex | abs_path = '/' >> rel_path |
const sregex | absoluteURI = scheme >> ':' >> *( uchar | reserved ) |
const sregex | escape = '%' >> xdigit >> xdigit |
const sregex | ex_net_path = "//" >> (s1 = net_loc) >> (s2 = !abs_path) |
const sregex | ex_rel_path = !( s1=path ) >> !( ';' >> (s2=params) ) >> !( '?' >> (s3=query) ) |
const sregex | ex_URI = !( (s1=scheme) >> ':' ) >> ( s2=relativeURI ) >> !( '#' >> (s3=fragment) ) |
const sregex | extra = bx::set[ as_xpr('!') | '*' | '\'' | '(' | ')' | ',' ] |
const sregex | fragment = *( uchar | reserved ) |
const sregex | fsegment = +pchar |
const sregex | national |
const sregex | net_loc = *( pchar | ';' | '?' ) |
const sregex | net_path = "//" >> net_loc >> !abs_path |
const sregex | param = *( pchar | '/' ) |
const sregex | params = param >> *( ';' >> param ) |
const sregex | path = fsegment >> *( '/' >> segment ) |
const sregex | pchar = ( uchar | ':' | '@' | '&' | '=' | '+' ) |
const sregex | query = *( uchar | reserved ) |
const sregex | rel_path = !path >> !( ';' >> params ) >> !( '?' >> query ) |
const sregex | relativeURI = net_path | abs_path | rel_path |
const sregex | reserved = bx::set[ as_xpr(';') | '/' | '?' | ':' | '@' | '&' | '=' | '+' ] |
const sregex | safe = bx::set[ as_xpr('$') | '-' | '_' | '.' ] |
const sregex | scheme = +( alpha | digit | '+' | '-' | '.' ) |
const sregex | segment = *pchar |
const sregex | uchar = ( unreserved | escape ) |
const sregex | unreserved = imbue(locale::classic())( alpha | digit | safe | extra | national ) |
const sregex | unsafe |
const sregex | URI = ( absoluteURI | relativeURI ) >> !( '#' >> fragment ) |
Descripció Detallada
- Autor
- Toni Corvera
- Id:
- Uri.cc 483 2013-06-17 17:41:04Z toni
Definició al fitxer Uri.cc.