llvm.org GIT mirror llvm / 5f62191
Include functionality to get a string array constant as a string git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1020 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 18 years ago
1 changed file(s) with 13 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
0 //===-- StringExtras.h - Useful string functions -----------------*- C++ -*--=//
11 //
22 // This file contains some functions that are useful when dealing with strings.
3 // No library is required when using these functinons.
43 //
54 //===----------------------------------------------------------------------===//
65
109 #include
1110 #include
1211 #include "llvm/Support/DataTypes.h"
12
13 class ConstPoolArray;
1314
1415 static inline string utostr(uint64_t X, bool isNeg = false) {
1516 char Buffer[40];
7273 for (unsigned i=0; i < indent; i++)
7374 os << istr;
7475 }
76
77 // Can we treat the specified array as a string? Only if it is an array of
78 // ubytes or non-negative sbytes.
79 //
80 bool isStringCompatible(ConstPoolArray *CPA);
81
82 // getAsCString - Return the specified array as a C compatible string, only if
83 // the predicate isStringCompatible is true.
84 //
85 string getAsCString(ConstPoolArray *CPA);
86
7587 #endif