VariadicSQLParser.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * Copyright (c) 2014, Oculus VR, Inc.
  3. * All rights reserved.
  4. *
  5. * This source code is licensed under the BSD-style license found in the
  6. * LICENSE file in the root directory of this source tree. An additional grant
  7. * of patent rights can be found in the PATENTS file in the same directory.
  8. *
  9. */
  10. #ifndef __VARIADIC_SQL_PARSER_H
  11. #define __VARIADIC_SQL_PARSER_H
  12. #include "DS_List.h"
  13. #include <stdarg.h>
  14. namespace VariadicSQLParser
  15. {
  16. struct IndexAndType
  17. {
  18. unsigned int strIndex;
  19. unsigned int typeMappingIndex;
  20. };
  21. const char* GetTypeMappingAtIndex(int i);
  22. void GetTypeMappingIndices( const char *format, DataStructures::List<IndexAndType> &indices );
  23. // Given an SQL string with variadic arguments, allocate argumentBinary and argumentLengths, and hold the parameters in binary format
  24. // Last 2 parameters are out parameters
  25. void ExtractArguments( va_list argptr, const DataStructures::List<IndexAndType> &indices, char ***argumentBinary, int **argumentLengths );
  26. void FreeArguments(const DataStructures::List<IndexAndType> &indices, char **argumentBinary, int *argumentLengths);
  27. }
  28. #endif
粤ICP备19079148号