src/types.h

changeset 504
6a1fa662bfc1
parent 503
bebe09014dd6
child 513
29eb671b34f6
equal deleted inserted replaced
503:bebe09014dd6 504:6a1fa662bfc1
44 typedef quint8 uint8; 44 typedef quint8 uint8;
45 typedef quint16 uint16; 45 typedef quint16 uint16;
46 typedef quint32 uint32; 46 typedef quint32 uint32;
47 typedef quint64 uint64; 47 typedef quint64 uint64;
48 48
49 template<class T> using List = QList<T>;
50 template<class T> using initlist = std::initializer_list<T>; 49 template<class T> using initlist = std::initializer_list<T>;
51 template<class T, class R> using pair = std::pair<T, R>; 50 template<class T, class R> using pair = std::pair<T, R>;
52 using std::size_t; 51 using std::size_t;
53 52
54 enum Axis { X, Y, Z }; 53 enum Axis { X, Y, Z };
202 StringFormatArg (const StringConfig& v); 201 StringFormatArg (const StringConfig& v);
203 StringFormatArg (const IntConfig& v); 202 StringFormatArg (const IntConfig& v);
204 StringFormatArg (const FloatConfig& v); 203 StringFormatArg (const FloatConfig& v);
205 StringFormatArg (const void* v); 204 StringFormatArg (const void* v);
206 205
207 template<class T> StringFormatArg (const List<T>& v) 206 template<class T> StringFormatArg (const QList<T>& v)
208 { m_val = "{ "; 207 { m_val = "{ ";
209 208
210 int i = 0; 209 int i = 0;
211 210
212 for (const T& it : v) 211 for (const T& it : v)
311 LDBoundingBox& operator<< (LDObject* obj); 310 LDBoundingBox& operator<< (LDObject* obj);
312 LDBoundingBox& operator<< (const vertex& v); 311 LDBoundingBox& operator<< (const vertex& v);
313 }; 312 };
314 313
315 // Formatter function 314 // Formatter function
316 str DoFormat (List<StringFormatArg> args); 315 str DoFormat (QList<StringFormatArg> args);
317 316
318 // printf replacement 317 // printf replacement
319 void doPrint (File& f, initlist<StringFormatArg> args); 318 void doPrint (File& f, initlist<StringFormatArg> args);
320 void doPrint (FILE* f, initlist<StringFormatArg> args); // heh 319 void doPrint (FILE* f, initlist<StringFormatArg> args); // heh
321 320

mercurial