You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ro...@apache.org on 2003/06/27 06:56:16 UTC
cvs commit: xml-axis/c/src/xml QName.h QName.cpp Makefile
roshan 2003/06/26 21:56:16
Added: c/src/xml QName.h QName.cpp Makefile
Log:
committing c++ code base
Revision Changes Path
1.1 xml-axis/c/src/xml/QName.h
Index: QName.h
===================================================================
/* -*- C++ -*- */
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "SOAP" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
*
*
*
* @author Roshan Weerasuriya (roshan@jkcs.slt.lk)
*
*/
// QName.h: interface for the QName class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_QNAME_H__7E4E7E7B_F051_4989_89A6_F0248109C410__INCLUDED_)
#define AFX_QNAME_H__7E4E7E7B_F051_4989_89A6_F0248109C410__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include <string>
using namespace std;
/**
* Qualified name according to "Namespaces in XML" specification.
*
* QName ::= (Prefix ':')? LocalPart <br>
* Prefix ::= NCName <br>
* LocalPart ::= NCName <br>
* NCName ::= (Letter | '_') (NCNameChar)* ; An XML Name, minus the ":" <br>
* NCNameChar ::= Letter | Digit | '.' | '-' | '_' etc. <br>
*
* The Prefix provides the namespace prefix part of the qualified name, and must
* be associated with a namespace URI reference in a namespace declaration.
* The LocalPart provides the local part of the qualified name.
* Note that the prefix functions only as a placeholder for a namespace name.
* Applications should use the namespace name, not the prefix, in constructing
* names whose scope extends beyond the containing document.
*
*
* @brief Qualified name according to "Namespaces in XML" specification
*/
class QName
{
public:
string& getPrefix();
string& getNamespaceURI();
string& getLocalPart();
QName(string& sNamespaceURI, string& sLocalPart, string& sPrefix);
QName(string& sNamespaceURI, string& sLocalPart);
QName(string& sLocalPart);
virtual ~QName();
private:
string m_sPrefix;
string m_sNamespaceURI;
string m_sLocalPart;
};
#endif // !defined(AFX_QNAME_H__7E4E7E7B_F051_4989_89A6_F0248109C410__INCLUDED_)
1.1 xml-axis/c/src/xml/QName.cpp
Index: QName.cpp
===================================================================
/* -*- C++ -*- */
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "SOAP" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
*
*
*
* @author Roshan Weerasuriya (roshan@jkcs.slt.lk)
*
*/
// QName.cpp: implementation of the QName class.
//
//////////////////////////////////////////////////////////////////////
#include "QName.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
QName::QName(string& sLocalPart)
{
m_sLocalPart= sLocalPart;
}
QName::QName(string& sNamespaceURI, string& sLocalPart)
{
m_sNamespaceURI= sNamespaceURI;
m_sLocalPart= sLocalPart;
}
QName::QName(string& sNamespaceURI, string& sLocalPart, string& sPrefix)
{
m_sNamespaceURI= sNamespaceURI;
m_sLocalPart= sLocalPart;
m_sPrefix= sPrefix;
}
QName::~QName()
{
}
string& QName::getLocalPart()
{
return m_sLocalPart;
}
string& QName::getNamespaceURI()
{
return m_sNamespaceURI;
}
string& QName::getPrefix()
{
return m_sPrefix;
}
1.1 xml-axis/c/src/xml/Makefile
Index: Makefile
===================================================================
# Makefile for axiscommon
#
#
# Modify the TOPDIR variable to point to the top of the
# directory tree where the Axis_Lib dir may be found.
#
BASE_PATH = ../..
include ../../inc.mk
LOCAL_INCLUDES = -I$(AX_DIR)/src/xml
PACKAGE_SRCS = QName.cpp
PACKAGE_OBJS = $(PACKAGE_SRCS:%.cpp=$(AX_OBJ_DIR_COMMON)/%.o)
all: MAKE_LIB
MAKE_LIB:OBJS
@echo "making xml.a" ;
$(AX_AR) $(AX_LIB_COMMON) $(AX_OBJ_DIR_COMMON)/*.o
#$(AX_OBJ_DIR_COMMON)/timestamp objects:
# @( cd $(AX_SRC_DIR) ; $(MAKE) -$(MAKEFLAGS) )
OBJS: $(PACKAGE_OBJS)
clean:
-@rm -rf $(AX_OBJ_DIR)/xml/*
-@rm -rf $(OBJS) *~