]> git.stg.codes - stg.git/blobdiff - stglibs/common.lib/include/stg/common.h
Added special function to read/write all data (for TCP).
[stg.git] / stglibs / common.lib / include / stg / common.h
index 1dd8c1c72f7694c7049abdf2650e1b0851b3ec05..0791f0938e9e89c327ba255f07f2b1f97f9a358d 100644 (file)
@@ -107,7 +107,7 @@ while (pos != std::string::npos)
     {
     res.push_back(conv(value.substr(startPos, pos - startPos)));
     startPos = pos + 1;
-    pos = value.find_first_of(delim, pos);
+    pos = value.find_first_of(delim, pos + 1);
     }
 res.push_back(conv(value.substr(startPos, pos - startPos)));
 return res;
@@ -139,6 +139,9 @@ int ParseYesNo(const std::string & str, bool * val);
 
 bool WaitPackets(int sd);
 
+bool ReadAll(int sd, void * dest, size_t size);
+bool WriteAll(int sd, const void * source, size_t size);
+
 //-----------------------------------------------------------------------------
 int str2x(const std::string & str, int32_t & x);
 int str2x(const std::string & str, uint32_t & x);