1
/* Copyright (C) 2006 Imperial College London and others.
3
Please see the AUTHORS file in the main source directory for a full list
7
Applied Modelling and Computation Group
8
Department of Earth Science and Engineering
9
Imperial College London
11
g.gorman@imperial.ac.uk
13
This library is free software; you can redistribute it and/or
14
modify it under the terms of the GNU Lesser General Public
15
License as published by the Free Software Foundation; either
16
version 2.1 of the License.
18
This library is distributed in the hope that it will be useful,
19
but WITHOUT ANY WARRANTY; without even the implied warranty of
20
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21
Lesser General Public License for more details.
23
You should have received a copy of the GNU Lesser General Public
24
License along with this library; if not, write to the Free Software
25
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
34
// default constructor
40
unn_t::unn_t(const unn_t& unn){
47
// return the unn as a c type string
48
const char *unn_t::number(){
52
// Overloaded operators.
53
unn_t & unn_t::operator=(const unn_t &a){
57
unn_t & unn_t::operator=(const string &a){
60
if( a.size() < UNN_LEN ){
61
sprintf(num, "%*s", UNN_LEN, a.c_str());
62
for(int i=0;i<UNN_LEN;i++){
69
strncpy(num, a.c_str(), UNN_LEN);
76
unn_t & unn_t::operator=(const int &a){
78
sprintf(num, "%0*d", UNN_LEN, a);