/** Return structured name of the current class/structure. */ CStrA DumpTarget::GetCurrentStructName() { CStrA out; if (!m_cur_struct.empty()) { /* we are inside some named struct, return its name */ out = m_cur_struct.top(); } return out.Transfer(); }
/** * Helper for creating a human readable output of this data. * @param dmp The location to dump to. */ template <typename D> void Dump(D &dmp) const { dmp.WriteLine("capacity = %d", Tcapacity); uint num_items = Length(); dmp.WriteLine("num_items = %d", num_items); CStrA name; for (uint i = 0; i < num_items; i++) { const T& item = (*this)[i]; name.Format("item[%d]", i); dmp.WriteStructT(name.Data(), &item); } }
CStrA(const CStrA& s_String) { ms8_Buf = 0; mu32_Size = 0; Allocate(max(DEFAULT_BUFSIZE, s_String.Len())); // throws strcpy(ms8_Buf, s_String); }
/** Lower-than operator (to support stl collections) */ FORCEINLINE bool operator < (const CStrA &other) const { return strcmp(base::Data(), other.Data()) < 0; }
/** Lower-than operator (to support stl collections) */ inline bool operator<(const CStrA &other) const { return strcmp(base::Data(), other.Data()) < 0; }
/** Translate TileIndex into string. */ CStrA TileStr(TileIndex tile) { CStrA out; out.Format("0x%04X (%d, %d)", tile, TileX(tile), TileY(tile)); return out.Transfer(); }
/** Return name of given SignalType. */ CStrA ValueStr(SignalType t) { CStrA out; out.Format("%d (%s)", t, ItemAtT(t, signal_type_names, "UNK")); return out.Transfer(); }
/** Return name of given DiagDirection. */ CStrA ValueStr(DiagDirection dd) { CStrA out; out.Format("%d (%s)", dd, ItemAtT(dd, diagdir_names, "UNK", INVALID_DIAGDIR, "INV")); return out.Transfer(); }
/** Return composed name of given TrackdirBits. */ CStrA ValueStr(TrackdirBits td_bits) { CStrA out; out.Format("%d (%s)", td_bits, ComposeNameT(td_bits, trackdir_names, "UNK", INVALID_TRACKDIR_BIT, "INV").Data()); return out.Transfer(); }
/** Return name of given Trackdir. */ CStrA ValueStr(Trackdir td) { CStrA out; out.Format("%d (%s)", td, ItemAtT(td, trackdir_names, "UNK", INVALID_TRACKDIR, "INV")); return out.Transfer(); }
void operator+=(const CStrA& s_String) { Allocate(Len() + s_String.Len()); strcat(ms8_Buf, s_String); }
void operator=(const CStrA& s_String) { Assign(s_String, s_String.Len()); }