Explorar o código

Merge branch 'master' of github.com:bkaradzic/bx

Бранимир Караџић %!s(int64=6) %!d(string=hai) anos
pai
achega
cc2afd434c
Modificáronse 2 ficheiros con 12 adicións e 4 borrados
  1. 8 0
      include/bx/string.h
  2. 4 4
      src/file.cpp

+ 8 - 0
include/bx/string.h

@@ -21,6 +21,7 @@ namespace bx
 	};
 
 	/// Non-zero-terminated string view.
+	///
 	class StringView
 	{
 	public:
@@ -77,9 +78,16 @@ namespace bx
 		///
 		void clear();
 
+		/// Returns pointer to non-terminated string.
+		///
+		/// @attention Use of this pointer in standard C/C++ functions is not safe. You must use it
+		///   in conjunction with `getTerm()` or getLength()`.
 		///
 		const char* getPtr() const;
 
+		/// Returns pointer past last character in string view.
+		///
+		/// @attention Dereferencing this pointer is not safe.
 		///
 		const char* getTerm() const;
 

+ 4 - 4
src/file.cpp

@@ -20,12 +20,12 @@
 #	if BX_CONFIG_CRT_DIRECTORY_READER
 #		include <dirent.h>
 #	endif // BX_CONFIG_CRT_DIRECTORY_READER
-#	include <stdio.h> // remove
+#	include <stdio.h>      // remove
+#	include <sys/stat.h>   // stat, mkdir
 #	if BX_CRT_MSVC
-#		include <direct.h>   // _getcwd
+#		include <direct.h> // _getcwd
 #	else
-#		include <sys/stat.h> // stat, mkdir
-#		include <unistd.h>   // getcwd
+#		include <unistd.h> // getcwd
 #	endif // BX_CRT_MSVC
 #endif // !BX_CRT_NONE