idep_nameindexmap.h File Reference

#include <iosfwd>

Go to the source code of this file.

Classes

class  idep_NameIndexMap

Functions

std::ostream & operator<< (std::ostream &out, const idep_NameIndexMap &map)

Function Documentation

std::ostream& operator<< ( std::ostream &  out,
const idep_NameIndexMap map 
)

Definition at line 149 of file idep_nimap.cxx.

References idep_NameIndexMap::length().

00150 {
00151     int fieldWidth = 10;
00152     int maxIndex = map.length() - 1;
00153     assert (sizeof (long int) >= 4);
00154     long int x = 1000 * 1000 * 1000;    // requires 4-byte integer.
00155     while (fieldWidth > 1 && 0 == maxIndex / x) {
00156         --fieldWidth;
00157         x /= 10;
00158     }
00159  
00160     for (int i = 0; i < map.length(); ++i) {
00161         out.width(fieldWidth);
00162         out << i << ". " << map[i] << std::endl;
00163     }
00164  
00165     return out;
00166 }


Generated on 16 Apr 2018 for loon by  doxygen 1.6.1