SDKBrowserURL Class Reference

#include <lib_browser.h>

Detailed Description

Represents a browser URL for locations in the file system (and virtual places somewhere in the browser).
For URL strings the following applies:

  • Set a file name as "file://localhost/...".
  • Set a preset location as "preset:// * /..." where * is the catalog name.
  • Set a catalog location as "catalog:// * /..." where * is the catalog name.
    See also
    SDKBrowserBase for base paths constants.

Private

void * GetPrivate (void) const
 

Constructor/Destructor

 SDKBrowserURL ()
 
 SDKBrowserURL (const SDKBrowserURL &src)
 
 SDKBrowserURL (const Filename &src)
 
 SDKBrowserURL (const maxon::String &src)
 
 ~SDKBrowserURL (void)
 

Operator

const SDKBrowserURLoperator= (const SDKBrowserURL &cs)
 
const SDKBrowserURL operator+ (const String &str2) const
 
const SDKBrowserURLoperator+= (const String &str)
 
Bool operator== (const SDKBrowserURL &url) const
 
Bool operator!= (const SDKBrowserURL &url) const
 

Information

Bool IsPopulated () const
 
SDKBrowserURL GetDirectory (void) const
 
String GetFileString (void) const
 
Bool IsFilename (void) const
 
Bool CheckSuffix (const String &s) const
 
String GetSuffix (void) const
 

Set/Get Filename/String

void SetFilename (const Filename &f)
 
void SetString (const String &s)
 
Bool GetFilename (Filename &f) const
 
Filename GetFilename (void) const
 
void GetString (String &s) const
 
String GetString (void) const
 

Constructor & Destructor Documentation

◆ SDKBrowserURL() [1/4]

Default constructor. Constructs a SDKBrowserURL.

◆ SDKBrowserURL() [2/4]

SDKBrowserURL ( const SDKBrowserURL src)

Copy constructor. Constructs a SDKBrowserURL with the content of the source URL in src.

Parameters
[in]srcA source URL.

◆ SDKBrowserURL() [3/4]

SDKBrowserURL ( const Filename src)

Constructs a SDKBrowserURL with a file name.

Parameters
[in]srcA file name.

◆ SDKBrowserURL() [4/4]

SDKBrowserURL ( const maxon::String src)

Constructs a SDKBrowserURL with a string.

Parameters
[in]srcA URL string, e.g. "file://localhost/image.jpg".

◆ ~SDKBrowserURL()

~SDKBrowserURL ( void  )

Destructor.

Member Function Documentation

◆ GetPrivate()

void* GetPrivate ( void  ) const

Private.

◆ operator=()

const SDKBrowserURL& operator= ( const SDKBrowserURL cs)

Assignment operator.

Parameters
[in]csThe right-hand URL to assign.
Returns
The assigned left-hand URL.

◆ operator+()

const SDKBrowserURL operator+ ( const String str2) const

Concatenates a string to the path of the URL and return the result.

Parameters
[in]str2The string to add.
Returns
The result of the addition.

◆ operator+=()

const SDKBrowserURL& operator+= ( const String str)

Concatenates a string to the path of the URL and keep the result in the URL.

Parameters
[in]strThe string to add.
Returns
The result of the addition.

◆ operator==()

Bool operator== ( const SDKBrowserURL url) const

Equality operator. Compares the URL with another URL.

Parameters
[in]urlThe right-hand URL to compare with.
Returns
true if the URLs are equal, otherwise false.

◆ operator!=()

Bool operator!= ( const SDKBrowserURL url) const

Inequality operator. Compares the URL with another URL.

Parameters
[in]urlThe right-hand URL to compare with.
Returns
true if the URLs are not equal, otherwise false.

◆ IsPopulated()

Bool IsPopulated ( ) const

Checks if the URL is empty.

Returns
true if the URL has been set, otherwise false.

◆ GetDirectory()

SDKBrowserURL GetDirectory ( void  ) const

Retrieves the URL of the parent directory.

Returns
The directory for the URL.

◆ GetFileString()

String GetFileString ( void  ) const

Retrieves the local file name only (without the path).

Returns
The file name string.

◆ IsFilename()

Bool IsFilename ( void  ) const

Checks if the URL can be represented as a Filename.

Returns
true if the URL can be represented as a Filename, otherwise false.

◆ CheckSuffix()

Bool CheckSuffix ( const String s) const

Checks if the suffix of the URL is the same as the string s.

Parameters
[in]sA suffix string without the dot, e.g. "c4d".
Returns
true if the suffix matches, otherwise false.

◆ GetSuffix()

String GetSuffix ( void  ) const

Retrieves the suffix of the URL (always in lower case).

Returns
The suffix string without the dot, e.g. "c4d".

◆ SetFilename()

void SetFilename ( const Filename f)

Assigns a file name to the URL.

Parameters
[in]fThe file name to assign.

◆ SetString()

void SetString ( const String s)

Assigns a string to the URL.

  • Set a file name as "file://localhost/...".
  • Set a preset location as "preset:// * /..." where * is the catalog name.
  • Set a catalog location as "catalog:// * /..." where * is the catalog name.
    Parameters
    [in]sThe string to assign.

◆ GetFilename() [1/2]

Bool GetFilename ( Filename f) const

Retrieves a Filename from the URL.

Parameters
[out]fAssigned the file name if method is successful.
Returns
true if the URL contains a filename (or a "file://" string) and assign that name to f.
false if the URL string is a catalog location or something else in the browser tree.

◆ GetFilename() [2/2]

Filename GetFilename ( void  ) const

Retrieves a Filename from the URL.

Returns
The URL as a file name if the URL contains a filename (or a "file://" string).
An empty Filename if the URL does not contain a file name.

◆ GetString() [1/2]

void GetString ( String s) const

Retrieves the URL string content.

Parameters
[out]sAssigned the URL string.

◆ GetString() [2/2]

String GetString ( void  ) const

Retrieves the URL string content.

Returns
The URL string.