Include functionality to get a string array constant as a string
authorChris Lattner <sabre@nondot.org>
Mon, 29 Oct 2001 13:24:31 +0000 (13:24 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 29 Oct 2001 13:24:31 +0000 (13:24 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1020 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/StringExtras.h

index a9e6bb3e83707a48df1d1dce39550481e84534cd..22d02c3140a9bd279869f5295df22d751576240a 100644 (file)
@@ -1,7 +1,6 @@
 //===-- StringExtras.h - Useful string functions -----------------*- C++ -*--=//
 //
 // This file contains some functions that are useful when dealing with strings.
-// No library is required when using these functinons.
 //
 //===----------------------------------------------------------------------===//
 
@@ -12,6 +11,8 @@
 #include <stdio.h>
 #include "llvm/Support/DataTypes.h"
 
+class ConstPoolArray;
+
 static inline string utostr(uint64_t X, bool isNeg = false) {
   char Buffer[40];
   char *BufPtr = Buffer+39;
@@ -73,4 +74,15 @@ printIndent(unsigned int indent, ostream& os=cout, const char* const istr="  ")
   for (unsigned i=0; i < indent; i++)
     os << istr;
 }
+
+// Can we treat the specified array as a string?  Only if it is an array of
+// ubytes or non-negative sbytes.
+//
+bool isStringCompatible(ConstPoolArray *CPA);
+
+// getAsCString - Return the specified array as a C compatible string, only if
+// the predicate isStringCompatible is true.
+//
+string getAsCString(ConstPoolArray *CPA);
+
 #endif