File: variable-result.cpp

package info (click to toggle)
anjuta 2%3A2.32.0.0-5
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 61,524 kB
  • ctags: 29,402
  • sloc: ansic: 207,516; xml: 31,169; cpp: 11,403; sh: 10,749; perl: 7,107; makefile: 3,373; yacc: 1,018; lex: 126; sql: 97; python: 91; java: 6
file content (89 lines) | stat: -rw-r--r-- 2,408 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
/*
 * anjuta
 * Copyright (C) Eran Ifrah (Main file for CodeLite www.codelite.org/ )
 * Copyright (C) Massimo Cora' 2009 <maxcvs@email.it> (Customizations for Anjuta)
 * 
 * anjuta is free software: you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * anjuta 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 General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License along
 * with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#include "variable-result.h"

Variable::Variable()
{
	reset();
}

Variable::~Variable()
{
}

Variable::Variable(const Variable &src)
{
	*this = src;
}

Variable & Variable::operator =(const Variable &src)
{
	m_type = src.m_type;
	m_templateDecl = src.m_templateDecl;
	m_name = src.m_name;
	m_isTemplate = src.m_isTemplate;
	m_isPtr = src.m_isPtr;
	m_typeScope = src.m_typeScope;
	m_pattern = src.m_pattern;
	m_starAmp = src.m_starAmp;
	m_lineno = src.m_lineno;
	m_isConst = src.m_isConst;
	m_defaultValue = src.m_defaultValue;
	m_arrayBrackets = src.m_arrayBrackets;
	return *this;
}

void Variable::reset()
{
	m_type = "";
	m_templateDecl = "";
	m_name = "";
	m_isTemplate = false;
	m_isPtr = false;
	m_typeScope = "";
	m_pattern = "";
	m_starAmp = "";
	m_lineno = 0;
	m_isConst = false;
	m_defaultValue = "";
	m_arrayBrackets = "";
}

void Variable::print()
{
	fprintf(    stdout, "{m_name=%s, m_defaultValue=%s, m_lineno=%d, m_starAmp=%s, "
	    "m_type=%s, m_isConst=%s, m_typeScope=%s, m_templateDecl=%s, m_arrayBrackets=%s, "
	    "m_isPtr=%s, m_isTemplate=%s }\n",		
				m_name.c_str(),
				m_defaultValue.c_str(),
				m_lineno,
				m_starAmp.c_str(),
				m_type.c_str(),
				m_isConst ? "true" : "false",
				m_typeScope.c_str(),
				m_templateDecl.c_str(),
				m_arrayBrackets.c_str(),
				m_isPtr ? "true" : "false",
				m_isTemplate ? "true" : "false");

	fprintf( stdout, "Pattern: %s\n", m_pattern.c_str());
	fflush(stdout);
}