A C++ DAL / ORM code generation framework
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
1.0 KiB

13 years ago
  1. #include "../src/sql/wsqldatum.h"
  2. #include <iostream>
  3. int main()
  4. {
  5. WSql::WSqlDatum dtm;
  6. double testd = 1455.096789;
  7. int testi = 99;
  8. std::string tests = "this is a string";
  9. dtm.setPrecision(5);
  10. dtm.setData(testd);
  11. double d = dtm.data<double>();
  12. std::cout.setf(std::ios::fixed, std::ios::floatfield);
  13. std::cout.precision(10);
  14. std::cout << "value: " << d << std::endl;
  15. // std::cout << "type: " << WSql::WSqlDataType::toString(dtm.dataType()) << std::endl;
  16. dtm.setData(testi);
  17. // dtm.setDataType(WSql::WSqlDataType::INT);
  18. int i = dtm.data<int>();
  19. std::cout << "value: " << i << std::endl;
  20. // std::cout << "type: " << WSql::WSqlDataType::toString(dtm.dataType()) << std::endl;
  21. dtm.setData<std::string>(tests);
  22. // dtm.setDataType(WSql::WSqlDataType::TEXT);
  23. std::string s = dtm.data<std::string>();
  24. std::cout << "value: " << s.c_str() << std::endl;
  25. // std::cout << "type: " << WSql::WSqlDataType::toString(dtm.dataType()) << std::endl;
  26. return 0;
  27. }