MCPcopy Create free account
hub / github.com/digego/extempore / getOSCString

Method getOSCString

src/OSC.cpp:864–889  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

862 }
863
864 int OSC::getOSCString(const char* data, std::string* str) {
865 int str_cnt = 0;
866 for( ;str_cnt<4096; ++str_cnt) {
867 if (data[str_cnt] == '\0') break;
868 str->push_back(data[str_cnt]);
869 }
870 str_cnt += (4 - (int)fmod((double)str_cnt,4.0));
871
872 //added because we need to quote quotes to add to scheme expressions
873 for(int i=0;i<str->length();i++)
874 {
875 if(str->at(i)=='"')
876 {
877 if(str->at(i-1) != '\\')
878 {
879 str->insert(i,"\\");
880 i++;
881 }
882 }
883 }
884
885#ifdef _OSC_DEBUG_
886 std::cout << "GET OSC STRING = " << *str << std::endl;
887#endif
888 return str_cnt;
889 }
890
891 int OSC::setOSCfloat(char* data, float* f) {
892#ifdef _OSC_DEBUG_

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected