ctkUtils.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*=========================================================================
  2. Library: CTK
  3. Copyright (c) Kitware Inc.
  4. All rights reserved.
  5. Distributed under a BSD License. See LICENSE.txt file.
  6. This software is distributed "AS IS" WITHOUT ANY WARRANTY; without even
  7. the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  8. See the above copyright notice for more information.
  9. =========================================================================*/
  10. #ifndef __ctkUtils_h
  11. #define __ctkUtils_h
  12. // QT includes
  13. #include <QStringList>
  14. // STD includes
  15. #include <vector>
  16. #include "CTKCoreExport.h"
  17. class CTK_CORE_EXPORT ctkUtils
  18. {
  19. public:
  20. typedef ctkUtils Self;
  21. ///
  22. /// Convert a QStringList to Vector of char*
  23. /// Caller will be responsible to delete the content of the vector
  24. static void qListToSTLVector(const QStringList& list, std::vector<char*>& vector);
  25. ///
  26. /// Convert a QStringList to a Vector of string
  27. static void qListToSTLVector(const QStringList& list, std::vector<std::string>& vector);
  28. ///
  29. /// Convert a Vector of string to QStringList
  30. static void stlVectorToQList(const std::vector<std::string>& vector, QStringList& list);
  31. private:
  32. /// Not implemented
  33. ctkUtils(){}
  34. virtual ~ctkUtils(){}
  35. };
  36. #endif