/*******************************************************************

Copyright (c) 2004 Open Mobile Alliance, Ltd.  All Rights Reserved.

This software is made available under the usage and distribution terms 
covered by the Common Public License 1.0 and by using this software you
are bound by the terms and conditions of the same.

EXCEPT AS EXPRESSLY SET FORTH IN THE COMMON PUBLIC LICENSE,
THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, 
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 
EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, 
ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, 
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
   
Each recipient is solely responsible for determining the 
appropriateness of using and distributing this program and assumes 
all risks associated with its exercise of rights under the Common 
Public License, including but not limited to the risks and 
costs of program errors, compliance with applicable laws, 
damage to or loss of data, programs or equipment, and 
unavailability or interruption of operations.

********************************************************************/

#ifndef _SCTS_URI_H
#define _SCTS_URI_H
#include "SctsPlatformLib.h"

#define MAX_URI_SIZE 256

class SctsURI
{
public:
	char *scheme;
	char *authority;
	char *path;
	char *query;
	char *fragment;
	char *Build();
	void Parse(char *uri);
	void Save(FILE *);
	bool IsAbsPath() {if (path && path[0]=='/') return true;return false;}
	bool IsOpaque() {if (scheme && !authority && path && !sctsStrchr(path,'/')) return false;return true;}
	bool IsValid() {return (scheme || authority || path || query || fragment);}
	SctsURI(char *uri) {scheme=authority=path=query=fragment=0;Parse(uri);}
	SctsURI(SctsURI& _uri);
	SctsURI(FILE *);
	~SctsURI();

};

#endif
