Beispiel #1
0
UnicodeString TStrings::GetDelimitedText() const
{
  UnicodeString Result;
  intptr_t Count = GetCount();
  if ((Count == 1) && GetString(0).IsEmpty())
  {
    Result = GetQuoteChar() + GetQuoteChar();
  }
  else
  {
    for (intptr_t I = 0; I < GetCount(); I++)
    {
      UnicodeString line = GetString(I);
      Result += GetQuoteChar() + line + GetQuoteChar() + GetDelimiter();
    }
    if (Result.Length() > 0)
      Result.SetLength(Result.Length() - 1);
  }
  return Result;
}
Beispiel #2
0
UnicodeString TStrings::GetCommaText() const
{
  wchar_t LOldDelimiter = GetDelimiter();
  wchar_t LOldQuoteChar = GetQuoteChar();
  FDelimiter = L',';
  FQuoteChar = L'"';
  UnicodeString Result;
  SCOPE_EXIT
  {
    FDelimiter = LOldDelimiter;
    FQuoteChar = LOldQuoteChar;
  };
  Result = GetDelimitedText();
  return Result;
}
Beispiel #3
0
UnicodeString TStrings::GetCommaText() const
{
  wchar_t LOldDelimiter = GetDelimiter();
  wchar_t LOldQuoteChar = GetQuoteChar();
  FDelimiter = L',';
  FQuoteChar = L'"';
  UnicodeString Result;
  auto cleanup = finally([&]()
  {
    FDelimiter = LOldDelimiter;
    FQuoteChar = LOldQuoteChar;
  });
  {
    Result = GetDelimitedText();
  }
  return Result;
}
Beispiel #4
0
const char* OUTPUTFORMATTER::GetQuoteChar( const char* wrapee )
{
    return GetQuoteChar( wrapee, quoteChar );
}