|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.kde.koala.KURL
public class KURL
Field Summary | |
---|---|
static int |
Auto
Defines the type of URI we are processing. |
static int |
CaseInsensitiveKeys
Options for queryItems() |
static int |
Invalid
|
static int |
Mailto
|
static int |
NoAdjustements
Flags to choose how file: URLs are treated when creating their String representation with prettyURL(int,AdjustementFlags) However it is recommended to use pathOrURL() instead of this variant of prettyURL() |
static int |
RawURI
|
static int |
StripFileProtocol
|
static int |
URL
|
Constructor Summary | |
---|---|
|
KURL()
|
protected |
KURL(java.lang.Class dummy)
|
|
KURL(KURL u)
|
|
KURL(KURL _baseurl,
java.lang.String _rel_url)
|
|
KURL(KURL _baseurl,
java.lang.String _rel_url,
int encoding_hint)
|
|
KURL(org.kde.qt.QUrlInterface u)
|
|
KURL(java.lang.String url)
|
|
KURL(java.lang.String url,
int encoding_hint)
|
Method Summary | |
---|---|
void |
addPath(java.lang.String txt)
|
void |
addQueryItem(java.lang.String _item,
java.lang.String _value)
|
void |
addQueryItem(java.lang.String _item,
java.lang.String _value,
int encoding_hint)
|
void |
adjustPath(int _trailing)
|
boolean |
cd(java.lang.String _dir)
|
void |
cleanPath()
|
void |
cleanPath(boolean cleanDirSeparator)
|
static java.lang.String |
decode_string(java.lang.String str)
|
static java.lang.String |
decode_string(java.lang.String str,
int encoding_hint)
|
java.lang.String |
directory()
|
java.lang.String |
directory(boolean _strip_trailing_slash_from_result)
|
java.lang.String |
directory(boolean _strip_trailing_slash_from_result,
boolean _ignore_trailing_slash_in_path)
|
void |
dispose()
Delete the wrapped C++ instance ahead of finalize() |
static java.lang.String |
encode_string_no_slash(java.lang.String str)
|
static java.lang.String |
encode_string_no_slash(java.lang.String str,
int encoding_hint)
|
static java.lang.String |
encode_string(java.lang.String str)
|
static java.lang.String |
encode_string(java.lang.String str,
int encoding_hint)
|
java.lang.String |
encodedHtmlRef()
|
java.lang.String |
encodedPathAndQuery()
|
java.lang.String |
encodedPathAndQuery(int _trailing)
|
java.lang.String |
encodedPathAndQuery(int _trailing,
boolean _no_empty_path)
|
java.lang.String |
encodedPathAndQuery(int _trailing,
boolean _no_empty_path,
int encoding_hint)
|
boolean |
equals(KURL u)
|
boolean |
equals(KURL u,
boolean ignore_trailing)
|
java.lang.String |
fileEncoding()
|
java.lang.String |
fileName()
|
java.lang.String |
fileName(boolean _ignore_trailing_slash_in_path)
|
protected void |
finalize()
Deletes the wrapped C++ instance |
static KURL |
fromPathOrURL(java.lang.String text)
|
boolean |
hasHost()
|
boolean |
hasHTMLRef()
|
boolean |
hasPass()
|
boolean |
hasPath()
|
boolean |
hasRef()
|
boolean |
hasSubURL()
|
boolean |
hasUser()
|
java.lang.String |
host()
|
java.lang.String |
htmlRef()
|
java.lang.String |
htmlURL()
|
boolean |
isDisposed()
Has the wrapped C++ instance been deleted? |
boolean |
isEmpty()
|
boolean |
isLocalFile()
|
boolean |
isParentOf(KURL u)
|
static boolean |
isRelativeURL(java.lang.String _url)
|
boolean |
isValid()
|
static KURL |
join(java.util.ArrayList _list)
|
boolean |
op_equals(KURL _u)
|
boolean |
op_equals(java.lang.String _u)
|
boolean |
op_lt(KURL _u)
|
boolean |
op_not_equals(KURL _u)
|
boolean |
op_not_equals(java.lang.String _u)
|
protected void |
parse(java.lang.String _url)
|
protected void |
parse(java.lang.String _url,
int encoding_hint)
|
protected void |
parseMailto(java.lang.String _url)
|
protected void |
parseMailto(java.lang.String _url,
int encoding_hint)
|
protected void |
parseRawURI(java.lang.String _url)
|
protected void |
parseRawURI(java.lang.String _url,
int encoding_hint)
|
protected void |
parseURL(java.lang.String _url)
|
protected void |
parseURL(java.lang.String _url,
int encoding_hint)
|
java.lang.String |
pass()
|
java.lang.String |
path()
|
java.lang.String |
path(int _trailing)
|
java.lang.String |
pathOrURL()
|
short |
port()
|
java.lang.String |
prettyURL()
|
java.lang.String |
prettyURL(int _trailing)
|
java.lang.String |
prettyURL(int _trailing,
int _flags)
|
java.lang.String |
protocol()
|
java.lang.String |
query()
|
java.lang.String |
queryItem(java.lang.String item)
|
java.lang.String |
queryItem(java.lang.String item,
int encoding_hint)
|
java.lang.String |
ref()
|
static java.lang.String |
relativePath(java.lang.String base_dir,
java.lang.String path)
|
static java.lang.String |
relativePath(java.lang.String base_dir,
java.lang.String path,
boolean[] isParent)
|
static java.lang.String |
relativeURL(KURL base_url,
KURL url)
|
static java.lang.String |
relativeURL(KURL base_url,
KURL url,
int encoding_hint)
|
void |
removeQueryItem(java.lang.String _item)
|
protected void |
reset()
|
void |
setDirectory(java.lang.String dir)
|
void |
setEncodedPath(java.lang.String _txt)
|
void |
setEncodedPath(java.lang.String _txt,
int encoding_hint)
|
void |
setEncodedPathAndQuery(java.lang.String _txt)
|
void |
setEncodedPathAndQuery(java.lang.String _txt,
int encoding_hint)
|
void |
setFileEncoding(java.lang.String encoding)
|
void |
setFileName(java.lang.String _txt)
|
void |
setHost(java.lang.String _txt)
|
void |
setHTMLRef(java.lang.String _ref)
|
void |
setPass(java.lang.String _txt)
|
void |
setPath(java.lang.String path)
|
void |
setPort(short _p)
|
void |
setProtocol(java.lang.String _txt)
|
void |
setQuery(java.lang.String _txt)
|
void |
setQuery(java.lang.String _txt,
int encoding_hint)
|
void |
setRef(java.lang.String _txt)
|
void |
setUser(java.lang.String _txt)
|
static java.util.ArrayList |
split(KURL _url)
|
static java.util.ArrayList |
split(java.lang.String _url)
|
KURL |
upURL()
|
int |
uriMode()
|
static int |
uriModeForProtocol(java.lang.String protocol)
|
java.lang.String |
url()
|
java.lang.String |
url(int _trailing)
|
java.lang.String |
url(int _trailing,
int encoding_hint)
|
java.lang.String |
user()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int NoAdjustements
public static final int StripFileProtocol
public static final int Auto
public static final int Invalid
public static final int RawURI
public static final int URL
public static final int Mailto
public static final int CaseInsensitiveKeys
Constructor Detail |
---|
protected KURL(java.lang.Class dummy)
public KURL()
public KURL(java.lang.String url, int encoding_hint)
url
- a URL, not a filename. If the URL does not have a protocol
part, @c "file:" is assumedencoding_hint
- MIB of original encoding of URL.
See QTextCodec.mibEnum()fromPathOrURL(java.lang.String)
public KURL(java.lang.String url)
public KURL(KURL u)
u
- the KURL to copypublic KURL(org.kde.qt.QUrlInterface u)
u
- the QUrlpublic KURL(KURL _baseurl, java.lang.String _rel_url, int encoding_hint)
_baseurl
- The base url._rel_url
- A relative or absolute URL.
If this is an absolute URL then _baseurl
will be ignored.
If this is a relative URL it will be combined with _baseurl.
Note that _rel_url
should be encoded too, in any case.
So do NOT pass a path here (use setPath() or addPath() or
fromPathOrURL() instead)encoding_hint
- MIB of original encoding of URL.
See QTextCodec.mibEnum()fromPathOrURL(java.lang.String)
public KURL(KURL _baseurl, java.lang.String _rel_url)
Method Detail |
---|
public java.lang.String protocol()
setProtocol(java.lang.String)
,
isValid()
public void setProtocol(java.lang.String _txt)
_txt
- the new protocol of the URL (without colon)protocol()
public int uriMode()
URIMode
,
uriModeForProtocol(java.lang.String)
public java.lang.String user()
setUser(java.lang.String)
,
hasUser()
public void setUser(java.lang.String _txt)
_txt
- the name of the user or null
to remove the useruser()
,
hasUser()
,
hasPass()
public boolean hasUser()
user()
,
setUser(java.lang.String)
,
hasPass()
public java.lang.String pass()
setPass(java.lang.String)
,
hasPass()
,
hasUser()
public void setPass(java.lang.String _txt)
_txt
- the password to set or null
to remove the passwordpass()
,
hasPass()
,
hasUser()
public boolean hasPass()
pass()
,
setPass(java.lang.String)
,
hasUser()
public java.lang.String host()
setHost(java.lang.String)
,
hasHost()
public void setHost(java.lang.String _txt)
_txt
- the new name of the host or null to remove the hosthost()
,
hasHost()
public boolean hasHost()
host()
,
setHost(java.lang.String)
public short port()
setPort(short)
,
host()
public void setPort(short _p)
_p
- the new port number or 0
to have no port numberport()
,
setHost(java.lang.String)
public java.lang.String path()
path(int)
,
setPath(java.lang.String)
,
hasPath()
public java.lang.String path(int _trailing)
_trailing
- May be ( @c -1, 0
, @c +1 ). @c -1 strips a trailing
path()
,
setPath(java.lang.String)
,
hasPath()
,
adjustPath(int)
public void setPath(java.lang.String path)
path
- the new, decoded, path or null
to remove the pathpath()
,
path(int)
,
hasPath()
public boolean hasPath()
path()
,
setPath(java.lang.String)
public void cleanPath(boolean cleanDirSeparator)
cleanDirSeparator
- if true
, occurrences of consecutive
directory separators (e.g. "/foo//bar") are cleaned up as
wellhasPath()
,
adjustPath(int)
public void cleanPath()
public void adjustPath(int _trailing)
_trailing
- May be ( @c -1, 0
, @c +1 ). @c -1 strips a trailinghasPath()
,
cleanPath(boolean)
public void setEncodedPathAndQuery(java.lang.String _txt, int encoding_hint)
_txt
- the new encoded path and encoded queryencoding_hint
- MIB of original encoding of _txt
.
See QTextCodec.mibEnum()encodedPathAndQuery(int, boolean, int)
,
setPath(java.lang.String)
,
setQuery(java.lang.String, int)
public void setEncodedPathAndQuery(java.lang.String _txt)
public void setEncodedPath(java.lang.String _txt, int encoding_hint)
_txt
- the new encoded pathencoding_hint
- MIB of original encoding of _txt
.
See QTextCodec.mibEnum()setEncodedPathAndQuery(java.lang.String, int)
,
setPath(java.lang.String)
public void setEncodedPath(java.lang.String _txt)
public java.lang.String encodedPathAndQuery(int _trailing, boolean _no_empty_path, int encoding_hint)
_trailing
- May be ( @c -1, 0
, @c +1 ). @c -1 strips a trailing_no_empty_path
- if set to true
then an empty path is substituted
by @c "/"encoding_hint
- MIB of desired encoding of URL.
See QTextCodec.mibEnum()
setEncodedPathAndQuery(java.lang.String, int)
,
path()
,
query()
public java.lang.String encodedPathAndQuery(int _trailing, boolean _no_empty_path)
public java.lang.String encodedPathAndQuery(int _trailing)
public java.lang.String encodedPathAndQuery()
public void setQuery(java.lang.String _txt, int encoding_hint)
_txt
- this is considered to be encoded. This has a good reason:
the query may contain the @c '0' characterencoding_hint
- MIB of the encoding. Reserved, should be 0
.
See QTextCodec.mibEnum()query()
public void setQuery(java.lang.String _txt)
public java.lang.String query()
setQuery(java.lang.String, int)
public java.lang.String ref()
setRef(java.lang.String)
,
hasRef()
,
htmlRef()
public void setRef(java.lang.String _txt)
_txt
- the encoded reference or null
to remove itref()
,
hasRef()
public boolean hasRef()
ref()
,
setRef(java.lang.String)
public java.lang.String htmlRef()
encodedHtmlRef()
,
setHTMLRef(java.lang.String)
,
hasHTMLRef()
,
split(java.lang.String)
,
hasSubURL()
,
ref()
public java.lang.String encodedHtmlRef()
htmlRef()
,
setHTMLRef(java.lang.String)
,
hasHTMLRef()
public void setHTMLRef(java.lang.String _ref)
_ref
- the new reference. This is considered to be not encoded in
contrast to setRef(). Use null
to remove ithtmlRef()
,
hasHTMLRef()
public boolean hasHTMLRef()
htmlRef()
,
encodedHtmlRef()
,
setHTMLRef(java.lang.String)
,
hasRef()
public boolean isValid()
public boolean isLocalFile()
public void setFileEncoding(java.lang.String encoding)
encoding
- the encoding to add or null
to remove the
encodingfileEncoding()
,
QTextCodec.codecForName(java.lang.String, int)
public java.lang.String fileEncoding()
public boolean hasSubURL()
split(java.lang.String)
public void addPath(java.lang.String txt)
txt
- the text to add. It is considered to be decodedsetPath(java.lang.String)
,
hasPath()
public java.lang.String queryItem(java.lang.String item)
item
- item whose value we want
addQueryItem(java.lang.String, java.lang.String, int)
,
removeQueryItem(java.lang.String)
,
#queryItems
,
query()
public java.lang.String queryItem(java.lang.String item, int encoding_hint)
item
- item whose value we wantencoding_hint
- MIB of encoding of query.
See QTextCodec.mibEnum()
addQueryItem(java.lang.String, java.lang.String, int)
,
removeQueryItem(java.lang.String)
,
#queryItems
,
query()
public void addQueryItem(java.lang.String _item, java.lang.String _value, int encoding_hint)
_item
- name of item to add_value
- value of item to addencoding_hint
- MIB of encoding to use for _value.
See QTextCodec.mibEnum()queryItem(java.lang.String)
,
#queryItems
,
query()
public void addQueryItem(java.lang.String _item, java.lang.String _value)
public void removeQueryItem(java.lang.String _item)
_item
- name of item to removeaddQueryItem(java.lang.String, java.lang.String, int)
,
queryItem(java.lang.String)
,
#queryItems
,
query()
public void setFileName(java.lang.String _txt)
_txt
- the filename to be set. It is considered to be decodedfileName(boolean)
,
setDirectory(java.lang.String)
,
setPath(java.lang.String)
public java.lang.String fileName(boolean _ignore_trailing_slash_in_path)
_ignore_trailing_slash_in_path
- if set to false
, then everything
behind the last @c '/' is considered to be the filename
setFileName(java.lang.String)
,
directory(boolean, boolean)
,
path()
public java.lang.String fileName()
public java.lang.String directory(boolean _strip_trailing_slash_from_result, boolean _ignore_trailing_slash_in_path)
_strip_trailing_slash_from_result
- tells whether the returned result
should end with @c '/' or not. If the path is empty or just @c "/"
then this flag has no effect_ignore_trailing_slash_in_path
- if set to false
, then everything
behind the last @c '/' is considered to be the filename
setDirectory(java.lang.String)
,
fileName(boolean)
,
path()
public java.lang.String directory(boolean _strip_trailing_slash_from_result)
public java.lang.String directory()
public void setDirectory(java.lang.String dir)
dir
- the decoded directory to setdirectory(boolean, boolean)
,
setFileName(java.lang.String)
,
setPath(java.lang.String)
public boolean cd(java.lang.String _dir)
_dir
- the directory to change to
directory(boolean, boolean)
,
path()
public java.lang.String url(int _trailing, int encoding_hint)
_trailing
- May be ( @c -1, 0
, @c +1 ). @c -1 strips a trailingencoding_hint
- MIB of encoding to use.
See QTextCodec.mibEnum()
prettyURL(int)
,
pathOrURL()
,
htmlURL()
public java.lang.String url(int _trailing)
public java.lang.String url()
public java.lang.String prettyURL(int _trailing)
_trailing
- May be ( @c -1, 0
, @c +1 ). @c -1 strips a trailing
url(int, int)
,
pathOrURL()
public java.lang.String prettyURL()
public java.lang.String prettyURL(int _trailing, int _flags)
_trailing
- May be ( @c -1, 0
, @c +1 ). @c -1 strips a trailing_flags
- if StripFileProtocol, @c "file://" will be stripped.
The use of this method is now discouraged, better use pathOrURL().
prettyURL(int)
,
url(int, int)
,
pathOrURL()
public java.lang.String pathOrURL()
prettyURL(int)
,
path()
,
url(int, int)
,
isLocalFile()
public java.lang.String htmlURL()
prettyURL(int)
,
url(int, int)
,
pathOrURL()
public boolean isEmpty()
hasPath()
,
protocol()
,
isValid()
public KURL upURL()
cd(java.lang.String)
,
split(java.lang.String)
,
hasSubURL()
,
path()
public boolean op_lt(KURL _u)
_u
- the URL to compare to
_u.
Otherwise @c false
(equal or greater than)#operator==
public boolean op_equals(KURL _u)
_u
- the URL to compare to
_u
is malformed.
Otherwise @c falseequals(org.kde.koala.KURL, boolean)
,
isValid()
,
#operator!=
,
#operator<
public boolean op_equals(java.lang.String _u)
_u
- the string to compare to
_u
is malformed.
Otherwise @c falseKURL(const
,
#int)
,
#operator==(const
,
KURL
,
equals(org.kde.koala.KURL, boolean)
,
isValid()
,
#operator!=
,
#operator<
public boolean op_not_equals(KURL _u)
_u
- the URL to compare to
#operator==
,
#operator<
public boolean op_not_equals(java.lang.String _u)
_u
- the URL to compare to
#operator==(const
,
#operator<
public boolean equals(KURL u, boolean ignore_trailing)
u
- the URL to compare this one withignore_trailing
- set to true
to ignore trailing @c '/' characters
#operator==#
,
This
,
#function
,
#should
,
#be
,
#used
,
#if
,
#you
,
#want
,
#to
,
#ignore
,
#trailing
,
@c
,
#characters
public boolean equals(KURL u)
public boolean isParentOf(KURL u)
u
(or the same URL as u
)equals(org.kde.koala.KURL, boolean)
,
cd(java.lang.String)
public static java.util.ArrayList split(java.lang.String _url)
_url
- the URL that has to be split
hasSubURL()
,
KURL(const
,
#int)
,
join(java.util.ArrayList)
public static java.util.ArrayList split(KURL _url)
_url
- the URL that has to be split
hasSubURL()
,
join(java.util.ArrayList)
public static KURL join(java.util.ArrayList _list)
_list
- the list to join
split(java.lang.String)
public static KURL fromPathOrURL(java.lang.String text)
text
- the string representation of the URL to convert
pathOrURL()
,
KURL(const
,
#int)
public static java.lang.String encode_string(java.lang.String str, int encoding_hint)
str
- the string to encode (can be null
)encoding_hint
- MIB of encoding to use.
See QTextCodec.mibEnum()
encode_string_no_slash(java.lang.String, int)
,
decode_string(java.lang.String, int)
public static java.lang.String encode_string(java.lang.String str)
public static java.lang.String encode_string_no_slash(java.lang.String str, int encoding_hint)
str
- the string to encode (can be null
)encoding_hint
- MIB of encoding to use.
See QTextCodec.mibEnum()encode_string(java.lang.String, int)
,
decode_string(java.lang.String, int)
public static java.lang.String encode_string_no_slash(java.lang.String str)
public static java.lang.String decode_string(java.lang.String str, int encoding_hint)
str
- the string to decode (can be null
)encoding_hint
- MIB of original encoding of str
.
See QTextCodec.mibEnum()
encode_string(java.lang.String, int)
,
encode_string_no_slash(java.lang.String, int)
public static java.lang.String decode_string(java.lang.String str)
public static boolean isRelativeURL(java.lang.String _url)
_url
- the URL to examine
relativeURL(org.kde.koala.KURL, org.kde.koala.KURL, int)
public static java.lang.String relativeURL(KURL base_url, KURL url, int encoding_hint)
base_url
- the URL to derive fromurl
- the URL to point to relatively from base_url
encoding_hint
- MIB of original encoding of str
.
See QTextCodec.mibEnum()isRelativeURL(java.lang.String)
,
relativePath(java.lang.String, java.lang.String, boolean[])
,
adjustPath(int)
public static java.lang.String relativeURL(KURL base_url, KURL url)
public static java.lang.String relativePath(java.lang.String base_dir, java.lang.String path, boolean[] isParent)
base_dir
- the base directory to derive frompath
- the new target directoryisParent
- an optional pointer to a booleanean which, if provided, will
be set to reflect whether path
has base_dir
as a parent dirrelativeURL(org.kde.koala.KURL, org.kde.koala.KURL, int)
public static java.lang.String relativePath(java.lang.String base_dir, java.lang.String path)
public static int uriModeForProtocol(java.lang.String protocol)
protocol
- the protocol name. See protocol()
uriMode()
protected void reset()
isValid()
,
isEmpty()
protected void parseURL(java.lang.String _url, int encoding_hint)
_url
- the string to parseencoding_hint
- MIB of original encoding of str
.
See QTextCodec.mibEnum()protected void parseURL(java.lang.String _url)
protected void parseRawURI(java.lang.String _url, int encoding_hint)
_url
- the string to parseencoding_hint
- MIB of original encoding of str
.
See QTextCodec.mibEnum()protected void parseRawURI(java.lang.String _url)
protected void parseMailto(java.lang.String _url, int encoding_hint)
_url
- the string to parseencoding_hint
- MIB of original encoding of str
.
See QTextCodec.mibEnum()protected void parseMailto(java.lang.String _url)
protected void parse(java.lang.String _url, int encoding_hint)
_url
- the string to parseencoding_hint
- MIB of original encoding of str
.
See QTextCodec.mibEnum()protected void parse(java.lang.String _url)
protected void finalize() throws java.lang.InternalError
finalize
in class java.lang.Object
java.lang.InternalError
public void dispose()
public boolean isDisposed()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |