浏览代码

added + chaiscript and set ascii text for clip.RegexReplace

Scott Brogden 1 年之前
父节点
当前提交
d8bc4e7c0b
共有 2 个文件被更改,包括 4 次插入1 次删除
  1. 3 1
      DittoChaiScript.cpp
  2. 1 0
      chaiscript/dispatchkit/bootstrap_stl.hpp

+ 3 - 1
DittoChaiScript.cpp

@@ -200,7 +200,9 @@ void CDittoChaiScript::AsciiTextReplaceRegex(std::string regex, std::string repl
 	CStringA newUtf8 = std::regex_replace(utf8.GetBuffer(), integer, replaceWith).c_str();
 	if (utf8 != newUtf8)
 	{
-		SetUnicodeString(CTextConvert::Utf8ToUnicode(newUtf8).GetBuffer());
+		CString uni = CTextConvert::Utf8ToUnicode(newUtf8).GetBuffer();
+		SetUnicodeString(uni.GetBuffer());
+		SetAsciiString(CTextConvert::UnicodeToAnsi(uni).GetBuffer());
 	}
 }
 

+ 1 - 0
chaiscript/dispatchkit/bootstrap_stl.hpp

@@ -720,6 +720,7 @@ namespace chaiscript
 		  m.add(fun([](const String *s, typename String::value_type c, size_t pos) { return s->find_first_not_of(c, pos); } ), "find_first_not_of");
 
 		  m.add(fun([](String *s, typename String::value_type c) -> decltype(auto) { return (*s += c); } ), "+=");
+		  m.add(fun([](String *s, typename String::value_type c) -> decltype(auto) { return (*s + c); } ), "+");
 		  
 		  m.add(fun([](String *s) { std::reverse(s->begin(), s->end()); } ), "reverse");