// @(#)root/reflex:$Id$ // Author: Stefan Roiser 2004 // Copyright CERN, CH-1211 Geneva 23, 2004-2006, All rights reserved. // // Permission to use, copy, modify, and distribute this software for any // purpose is hereby granted without fee, provided that this copyright and // permissions notice appear in all copies and derivatives. // // This software is provided "as is" without express or implied warranty. #ifndef REFLEX_BUILD # define REFLEX_BUILD #endif #include "Reflex/Any.h" #include #include //------------------------------------------------------------------------------- std::ostream& Reflex::operator <<(std::ostream& o, const Any& any) { //------------------------------------------------------------------------------- // Puts the different any objects on the ostream. if (any.TypeInfo() == typeid(char)) { o << any_cast(any); } else if (any.TypeInfo() == typeid(int)) { o << any_cast(any); } else if (any.TypeInfo() == typeid(short)) { o << any_cast(any); } else if (any.TypeInfo() == typeid(long)) { o << any_cast(any); } else if (any.TypeInfo() == typeid(float)) { o << any_cast(any); } else if (any.TypeInfo() == typeid(double)) { o << any_cast(any); } else if (any.TypeInfo() == typeid(const char*)) { o << any_cast(any); } else if (any.TypeInfo() == typeid(std::string)) { o << any_cast(any); } else { o << "Any object at " << std::hex << &static_cast*>(any.fContent)->fHeld << std::dec; } return o; } // <<