1
//=============================================================================
3
// File : KviKvsTreeNodeConstantData.cpp
4
// Creation date : Tue 07 Oct 2003 02:21:59 by Szymon Stefanek
6
// This file is part of the KVIrc IRC client distribution
7
// Copyright (C) 2003-2010 Szymon Stefanek <pragma at kvirc dot net>
9
// This program is FREE software. You can redistribute it and/or
10
// modify it under the terms of the GNU General Public License
11
// as published by the Free Software Foundation; either version 2
12
// of the License, or (at your opinion) any later version.
14
// This program is distributed in the HOPE that it will be USEFUL,
15
// but WITHOUT ANY WARRANTY; without even the implied warranty of
16
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17
// See the GNU General Public License for more details.
19
// You should have received a copy of the GNU General Public License
20
// along with this program. If not, write to the Free Software Foundation,
21
// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23
//=============================================================================
25
#include "KviKvsTreeNodeConstantData.h"
28
KviKvsTreeNodeConstantData::KviKvsTreeNodeConstantData(const QChar * pLocation,KviKvsVariant * v)
29
: KviKvsTreeNodeData(pLocation)
35
KviKvsTreeNodeConstantData::~KviKvsTreeNodeConstantData()
40
void KviKvsTreeNodeConstantData::contextDescription(QString &szBuffer)
42
szBuffer = "Constant Data Evaluation";
45
bool KviKvsTreeNodeConstantData::convertStringConstantToNumeric()
47
if(m_pValue->isString())
50
if(m_pValue->asInteger(iVal))
52
m_pValue->setInteger(iVal);
57
if(m_pValue->asReal(dVal))
59
m_pValue->setReal(dVal);
66
void KviKvsTreeNodeConstantData::dump(const char * prefix)
68
qDebug("%s ConstantData",prefix);
71
m_pValue->dump(tmp.toUtf8().data());
74
bool KviKvsTreeNodeConstantData::evaluateReadOnly(KviKvsRunTimeContext *,KviKvsVariant * pBuffer)
76
pBuffer->copyFrom(m_pValue);