void parse(const char *name, bool interpretDirs = true)
Use this method to parse an URL. The advantage of using
this instead of your own routine is that :
.
You don't have to reinvent the wheel
.
This function uses internal library variables so as to determine
whether 'smb://foo' represents a host or a workgroup.
The following format are accepted :
.
smb://user:password@workgroup/host/share/path
.
smb://user:password@host:IP/share/path
.
\\host\share\path
You can omit any field, so long as there is no confusion. For example opendir("smb://") is a virtual directory that contains the list of workgroups, but "smb://share/path" is invalid (or rather, it will not do what you expect).
name should contain the URL to parse in ASCIIZ.
interpretDirs should be set to true (default) if you want the library to interpret "." and ".." as special directories.
You can get the parsed results using the corresponding functions. For example, user() will return the user component of the last parsed URL. Unlike the previous versions of libsmb, you should not delete those results.
Does the opposite of the parser
char
*buildURL(const
char* user=0, const
char* password=0, const
char* workgroup=0, const
char *host=0, const
char* share=0, const
char* path=0, const
char* ip=0)
Copyright © Nicolas Brodu, 1999 - 2000