moved back to old acc
[vox.git] / src / core / string.hpp
blob096225d30b6ffdfbb979fd5147cb6db9a583a9c8
2 #ifndef _VXSTRING_H_
3 #define _VXSTRING_H_
5 #include "pcheader.hpp"
6 #include "object.hpp"
7 #include "state.hpp"
8 #include <string>
10 std::string strhelp_quote(const std::string& str, bool escape_only=false);
12 inline VXHash _hashstr(const char* s, size_t l)
14 VXHash h = (VXHash)l; /* seed */
15 size_t step = (l>>5)|1; /* if string is too long, don't hash all its chars */
16 for (; l>=step; l-=step)
18 h = h ^ ((h<<5)+(h>>2)+(unsigned short)*(s++));
20 return h;
24 #endif //_VXSTRING_H_