1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
|
/********************************************************************************
* *
* U R L M a n i p u l a t i o n *
* *
*********************************************************************************
* Copyright (C) 2000,2022 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as published by *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
* This library 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 Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/> *
********************************************************************************/
#ifndef FXURL_H
#define FXURL_H
namespace FX {
namespace FXURL {
/// Encode control characters and characters from set using %-encoding
extern FXAPI FXString encode(const FXString& string,const FXchar* set=nullptr);
/// Decode string containing %-encoded characters
extern FXAPI FXString decode(const FXString& string);
/// Parse scheme from string containing url
extern FXAPI FXString scheme(const FXString& string);
/// Parse username from string containing url
extern FXAPI FXString username(const FXString& string);
/// Parse password from string containing url
extern FXAPI FXString password(const FXString& string);
/// Parse hostname from string containing url
extern FXAPI FXString host(const FXString& string);
/// Parse port number from string containing url
extern FXAPI FXint port(const FXString& string,FXint def=0);
/// Parse path from string containing url
extern FXAPI FXString path(const FXString& string);
/// Parse query from string containing url
extern FXAPI FXString query(const FXString& string);
/// Parse fragment from string containing url
extern FXAPI FXString fragment(const FXString& string);
/// Return URL of filename
extern FXAPI FXString fileToURL(const FXString& string);
/// Return filename from URL, empty if url is not a local file
extern FXAPI FXString fileFromURL(const FXString& string);
/// Make URI list from array of filenames
extern FXAPI FXString filesToURIList(const FXString* files);
/// Make array of filenames from URI list
extern FXAPI FXString* filesFromURIList(const FXString& urilist);
}
}
#endif
|