Files
libreoffice/connectivity/source/parse/internalnode.cxx

93 lines
3.6 KiB
C++
Raw Normal View History

2000-09-18 15:18:56 +00:00
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2000-09-18 15:18:56 +00:00
*
* Copyright 2008 by Sun Microsystems, Inc.
2000-09-18 15:18:56 +00:00
*
* OpenOffice.org - a multi-platform office productivity suite
2000-09-18 15:18:56 +00:00
*
* $RCSfile: internalnode.cxx,v $
* $Revision: 1.7 $
2000-09-18 15:18:56 +00:00
*
* This file is part of OpenOffice.org.
2000-09-18 15:18:56 +00:00
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
2000-09-18 15:18:56 +00:00
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
2000-09-18 15:18:56 +00:00
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
2000-09-18 15:18:56 +00:00
*
************************************************************************/
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_connectivity.hxx"
2000-09-18 15:18:56 +00:00
#include "internalnode.hxx"
2000-10-26 10:01:57 +00:00
#include <algorithm>
2000-09-18 15:18:56 +00:00
#include <connectivity/sqlparse.hxx>
using namespace connectivity;
//-----------------------------------------------------------------------------
OSQLInternalNode::OSQLInternalNode(const sal_Char* pNewValue,
SQLNodeType eNodeType,
sal_uInt32 nNodeID)
2000-10-19 10:47:14 +00:00
: OSQLParseNode(pNewValue,eNodeType,nNodeID)
2000-09-18 15:18:56 +00:00
{
2001-03-21 12:52:43 +00:00
OSL_ENSURE(OSQLParser::s_pGarbageCollector, "Collector not initialized");
2000-09-18 15:18:56 +00:00
OSQLParser::s_pGarbageCollector->push_back(this);
}
//-----------------------------------------------------------------------------
2000-10-19 10:47:14 +00:00
OSQLInternalNode::OSQLInternalNode(const ::rtl::OString &_NewValue,
2000-09-18 15:18:56 +00:00
SQLNodeType eNodeType,
sal_uInt32 nNodeID)
:OSQLParseNode(_NewValue,eNodeType,nNodeID)
{
2001-03-21 12:52:43 +00:00
OSL_ENSURE(OSQLParser::s_pGarbageCollector, "Collector not initialized");
2000-09-18 15:18:56 +00:00
OSQLParser::s_pGarbageCollector->push_back(this);
}
//-----------------------------------------------------------------------------
OSQLInternalNode::OSQLInternalNode(const sal_Unicode* pNewValue,
SQLNodeType eNodeType,
sal_uInt32 nNodeID)
:OSQLParseNode(pNewValue,eNodeType,nNodeID)
{
2001-03-21 12:52:43 +00:00
OSL_ENSURE(OSQLParser::s_pGarbageCollector, "Collector not initialized");
2000-09-18 15:18:56 +00:00
OSQLParser::s_pGarbageCollector->push_back(this);
}
//-----------------------------------------------------------------------------
2000-10-19 10:47:14 +00:00
OSQLInternalNode::OSQLInternalNode(const ::rtl::OUString &_NewValue,
2000-09-18 15:18:56 +00:00
SQLNodeType eNodeType,
sal_uInt32 nNodeID)
:OSQLParseNode(_NewValue,eNodeType,nNodeID)
{
2001-03-21 12:52:43 +00:00
OSL_ENSURE(OSQLParser::s_pGarbageCollector, "Collector not initialized");
2000-09-18 15:18:56 +00:00
OSQLParser::s_pGarbageCollector->push_back(this);
}
//-----------------------------------------------------------------------------
OSQLInternalNode::~OSQLInternalNode()
{
// remove the node from the garbage list
2001-03-21 12:52:43 +00:00
OSL_ENSURE(OSQLParser::s_pGarbageCollector, "Collector not initialized");
2000-09-18 15:18:56 +00:00
if (!OSQLParser::s_pGarbageCollector->empty())
{
OSQLParser::s_pGarbageCollector->erase(
::std::find(OSQLParser::s_pGarbageCollector->begin(), OSQLParser::s_pGarbageCollector->end(),
this));
}
}