urlutils.h

来自「PTypes (C++ Portable Types Library) is a」· C头文件 代码 · 共 62 行

H
62
字号
/* * *  C++ Portable Types Library (PTypes) *  Version 1.7.5   Released 9-Mar-2003 * *  Copyright (c) 2001, 2002, 2003 Hovik Melikyan * *  http://www.melikyan.com/ptypes/ *  http://ptypes.sourceforge.net/ * */#ifndef W_URLUTILS_H#define W_URLUTILS_H#include <pport.h>#include <ptypes.h>USING_PTYPES////  URL utilities////  URL ::= <scheme>://[<authinfo>][<host>[:<port>]]/[<url-path>][<extra>]//  <authinfo> ::= <user>[:<password>]@//  <extra> ::=  [ ;<protocol-params> ] [ ?<query-params> ] [ #<fragment> ]//struct urlrec {    string scheme;      // 'http', 'ftp', 'file', ...    string username;    // for ftp scheme defaults to opt_anonymous_username    string password;    // for ftp scheme defaults to opt_anonymous_password    bool   pwdset;      // empty password and NO password is not the same!    string host;        // Internet or NetBIOS host name    int    port;        // 0 = default for the given scheme    string path;        // be careful with the leading '/' (RFC1738)    string proto;       // ';'    string query;       // '?'    string fragment;    // '#'    urlrec();};extern char* opt_anonymous_username;extern char* opt_anonymous_password;extern char* opt_default_urlscheme;bool   isurl(const string& s);void   urlclear(urlrec& u);string urlencodepath(const string& path);string urlcreate(const urlrec& u);void   urlcrack(const string& s, urlrec& u);#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?