summaryrefslogtreecommitdiffstats
path: root/source/core/slang-io.cpp
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2023-04-25 12:25:52 -0400
committerGitHub <noreply@github.com>2023-04-25 09:25:52 -0700
commit5abee6a0a30c7c965138ec7286b7f1b21b201731 (patch)
tree0469f6f85bac0fcf502a95f2a60c49179349dd17 /source/core/slang-io.cpp
parente5d5e3c215f3300bf447e6ab46cdf8d5c12f58a6 (diff)
StringBuilder to lowerCamel (#2840)
* #include an absolute path didn't work - because paths were taken to always be relative. * WIP lowerCamel Dictionary. * WIP more lowerCamel fixes for Dictionary. * Add/Remove/Clear * GetValue/Contains * Fix tabs in dictionary. Count -> getCount * Fix fields with caps. * Key -> key Value -> value Use m_ for members where appropriate. Use lowerCamel in linked list. * Some small fixes/improvements to Dictionary. * Kick CI. * Small tidy on String. * Append -> append * ToString -> toString ProduceString -> produceString * Small fixes. * StringToXXX -> stringToXXX * Fix typo introduced by Append -> append. * Made intToAscii do reversal at the end. --------- Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'source/core/slang-io.cpp')
-rw-r--r--source/core/slang-io.cpp23
1 files changed, 11 insertions, 12 deletions
diff --git a/source/core/slang-io.cpp b/source/core/slang-io.cpp
index 50e98c60c..52187bd47 100644
--- a/source/core/slang-io.cpp
+++ b/source/core/slang-io.cpp
@@ -189,10 +189,10 @@ namespace Slang
if (dotPos < 0)
dotPos = path.getLength();
- sb.Append(path.getBuffer(), dotPos);
- sb.Append('.');
- sb.Append(newExt);
- return sb.ProduceString();
+ sb.append(path.getBuffer(), dotPos);
+ sb.append('.');
+ sb.append(newExt);
+ return sb.produceString();
}
/* static */ Index Path::findLastSeparatorIndex(UnownedStringSlice const& path)
@@ -325,7 +325,7 @@ namespace Slang
/* static */void Path::combineIntoBuilder(const UnownedStringSlice& path1, const UnownedStringSlice& path2, StringBuilder& outBuilder)
{
outBuilder.clear();
- outBuilder.Append(path1);
+ outBuilder.append(path1);
append(outBuilder, path2);
}
@@ -338,7 +338,7 @@ namespace Slang
StringBuilder sb;
combineIntoBuilder(path1.getUnownedSlice(), path2.getUnownedSlice(), sb);
- return sb.ProduceString();
+ return sb.produceString();
}
String Path::combine(const String& path1, const String& path2, const String& path3)
{
@@ -346,7 +346,7 @@ namespace Slang
sb.append(path1);
append(sb, path2.getUnownedSlice());
append(sb, path3.getUnownedSlice());
- return sb.ProduceString();
+ return sb.produceString();
}
/* static */ bool Path::isDriveSpecification(const UnownedStringSlice& element)
@@ -546,7 +546,7 @@ namespace Slang
// Reconstruct the string
StringBuilder builder;
join(splitPath.getBuffer(), splitPath.getCount(), builder);
- return builder.ToString();
+ return builder.toString();
}
bool Path::createDirectory(const String& path)
@@ -1059,7 +1059,7 @@ namespace Slang
i++;
}
}
- return sb.ProduceString();
+ return sb.produceString();
}
StringSlice URI::getProtocol() const
@@ -1099,9 +1099,8 @@ namespace Slang
else
{
char buffer[32];
- int length = IntToAscii(buffer, (int)ch, 16);
- ReverseInternalAscii(buffer, length);
- sb << "%" << buffer;
+ int length = intToAscii(buffer, (int)ch, 16);
+ sb << "%" << UnownedStringSlice(buffer, length);
}
}
return URI::fromString(sb.getUnownedSlice());