2009-05-11 04:48:03 +04:00
|
|
|
/*
|
2009-05-14 02:19:42 +04:00
|
|
|
* Copyright 2007-2009 Haiku Inc. All rights reserved.
|
2009-05-11 04:48:03 +04:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
|
|
|
#ifndef _URL_H
|
|
|
|
#define _URL_H
|
|
|
|
|
|
|
|
#include <String.h>
|
|
|
|
|
2009-05-14 02:19:42 +04:00
|
|
|
|
2009-05-11 04:48:03 +04:00
|
|
|
namespace BPrivate {
|
|
|
|
namespace Support {
|
|
|
|
|
|
|
|
class BUrl : public BString {
|
|
|
|
public:
|
2009-05-14 02:19:42 +04:00
|
|
|
BUrl(const char* url);
|
2009-05-13 05:05:42 +04:00
|
|
|
~BUrl();
|
|
|
|
|
|
|
|
status_t InitCheck() const;
|
|
|
|
|
|
|
|
bool HasPreferredApplication() const;
|
|
|
|
BString PreferredApplication() const;
|
2009-05-14 02:19:42 +04:00
|
|
|
status_t OpenWithPreferredApplication(
|
|
|
|
bool onProblemAskUser = true) const;
|
2009-05-13 05:05:42 +04:00
|
|
|
|
|
|
|
bool HasHost() const;
|
|
|
|
bool HasPort() const;
|
|
|
|
bool HasUser() const;
|
|
|
|
bool HasPass() const;
|
|
|
|
bool HasPath() const;
|
|
|
|
|
2009-05-14 02:19:42 +04:00
|
|
|
const BString& Proto() const;
|
|
|
|
const BString& Full() const;
|
|
|
|
const BString& Host() const;
|
|
|
|
const BString& Port() const;
|
|
|
|
const BString& User() const;
|
|
|
|
const BString& Pass() const;
|
|
|
|
const BString& Path() const;
|
2009-05-13 05:05:42 +04:00
|
|
|
|
2009-05-11 04:48:03 +04:00
|
|
|
private:
|
2009-05-13 05:05:42 +04:00
|
|
|
status_t _ParseAndSplit();
|
|
|
|
BString _UrlMimeType() const;
|
|
|
|
|
2009-05-14 02:19:42 +04:00
|
|
|
BString fProto;
|
|
|
|
BString fFull;
|
|
|
|
BString fHost;
|
|
|
|
BString fPort;
|
|
|
|
BString fUser;
|
|
|
|
BString fPass;
|
|
|
|
BString fPath;
|
2009-05-13 05:05:42 +04:00
|
|
|
status_t fStatus;
|
2009-05-11 04:48:03 +04:00
|
|
|
};
|
|
|
|
|
2009-05-14 02:19:42 +04:00
|
|
|
} // namespace Support
|
|
|
|
} // namespace BPrivate
|
2009-05-11 04:48:03 +04:00
|
|
|
|
|
|
|
#endif // _URL_H
|
|
|
|
|