/* This software is distributed under the Lesser General Public License */
//
// Attributes.cpp
//
// This file implements the classes
//
//------------------------------------------ CVS
//
// CVS Headers -- The following headers are generated by the CVS
// version control system. Note that especially the attribute
// Author is not necessarily the author of the code.
//
// $Source: /home/br/CVS/graphlet/src/gt_base/Attributes.cpp,v $
// $Author: himsolt $
// $Revision: 1.2 $
// $Date: 1999/03/05 20:43:09 $
// $Locker:  $
// $State: Exp $
//
//------------------------------------------ CVS
//
// (C) University of Passau 1995-1999, graphlet Project
//

#include "Graphlet.h"
#include "GML.h"
#include "Key_description.h"

#include "Attributes.h"


//////////////////////////////////////////
//
// Printing
//
//////////////////////////////////////////


void GT_print (ostream& out, const int i)
{
    out << i << '\n';
}


// #include "iostream.h"

void GT_print (ostream& out, const double d)
{
    char buffer[32];
    sprintf (buffer, "%.1f", d);

    for (int i = strlen(buffer); buffer[i-1] == '0'; i--) {
	buffer[i] = '\0';
    }
    
    
    out << buffer << '\n';
}


void GT_print (ostream& out, const string& s)
{
    graphlet->gml->write_quoted (out, s);
    out << '\n';
}



void GT_print (ostream& out, const GT_Key k)
{
    graphlet->gml->write_quoted (out, k.description()->name());
    out << '\n';
}
