generic.cpp 791 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #include "Generic.h"
  2. #include <iostream>
  3. #include <stdio.h>
  4. #include "Str.h"
  5. using namespace std;
  6. using namespace Crown;
  7. int main()
  8. {
  9. Generic g1(5), g2(5.4f);
  10. Generic g3("[Lol asd]");
  11. Generic g4("-2147483648");
  12. Generic g5("4294967295");
  13. Generic g6("3.1415");
  14. Str s1, s2, s3;
  15. g1.asStr(s1);
  16. g2.asStr(s2);
  17. g3.asStr(s3);
  18. int i1 = 0;
  19. unsigned int ui1 = 0;
  20. float f1 = 0.0f;
  21. g4.asInt(i1);
  22. g5.asUInt(ui1);
  23. g6.asFloat(f1);
  24. GenericList list;
  25. list.Append("xD");
  26. list.Append(1);
  27. list.Append(true);
  28. list.Append(15.4f);
  29. Generic gList = list;
  30. Str sList;
  31. gList.asStr(sList);
  32. cout << s1.c_str() <<" "<< s2.c_str() <<" "<< s3.c_str() << endl;
  33. cout << i1 << " " << ui1 << " " << f1 << endl;
  34. cout << sList.c_str() << endl;
  35. cout << list.ToStr().c_str() << endl;
  36. getchar();
  37. }