本文整理汇总了C++中StringList::Clear方法的典型用法代码示例。如果您正苦于以下问题:C++ StringList::Clear方法的具体用法?C++ StringList::Clear怎么用?C++ StringList::Clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StringList
的用法示例。
在下文中一共展示了StringList::Clear方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ClearData
inline void ClearData()
{
for(UINT i=0; i<windowData.Num(); i++)
windowData[i].strClass.Clear();
windowData.Clear();
adminWindows.Clear();
opposingBitWindows.Clear();
}
示例2: TraceCrashEnd
void STDCALL TraceCrashEnd()
{
String strStackTrace = TEXT("\r\nException Fault - Stack Trace:");
for(unsigned int i=0; i<TraceFuncList.Num(); i++)
{
if(i) strStackTrace << TEXT(" -> ");
if(!(i%10)) strStackTrace << TEXT("\r\n ");
strStackTrace << TraceFuncList[i];
}
if(TraceFuncList.Num() == MAX_STACK_TRACE)
strStackTrace << TEXT(" -> ...");
String strOut = FormattedString(TEXT("%s\r\n"), strStackTrace.Array());
OpenLogFile();
LogFile.WriteAsUTF8(strOut, strOut.Length());
LogFile.WriteAsUTF8(TEXT("\r\n"));
CloseLogFile();
OSMessageBox(TEXT("Error: Exception fault - More info in the log file.\r\n\r\nMake sure you're using the latest verison, otherwise send your log to [email protected]"));
TraceFuncList.Clear();
CriticalExit();
}
示例3: strlen
size_t
StringList::AutoComplete (const char *s, StringList &matches, size_t &exact_idx) const
{
matches.Clear();
exact_idx = SIZE_MAX;
if (s && s[0])
{
const size_t s_len = strlen (s);
const size_t num_strings = m_strings.size();
for (size_t i=0; i<num_strings; ++i)
{
if (m_strings[i].find(s) == 0)
{
if (exact_idx == SIZE_MAX && m_strings[i].size() == s_len)
exact_idx = matches.GetSize();
matches.AppendString (m_strings[i]);
}
}
}
else
{
// No string, so it matches everything
matches = *this;
}
return matches.GetSize();
}
示例4: AutoComplete
size_t OptionValue::AutoComplete(CommandInterpreter &interpreter, const char *s,
int match_start_point, int max_return_elements,
bool &word_complete, StringList &matches) {
word_complete = false;
matches.Clear();
return matches.GetSize();
}
示例5: completion_str
int
CommandObjectRegexCommand::HandleCompletion (Args &input,
int &cursor_index,
int &cursor_char_position,
int match_start_point,
int max_return_elements,
bool &word_complete,
StringList &matches)
{
if (m_completion_type_mask)
{
std::string completion_str (input.GetArgumentAtIndex (cursor_index), cursor_char_position);
CommandCompletions::InvokeCommonCompletionCallbacks (m_interpreter,
m_completion_type_mask,
completion_str.c_str(),
match_start_point,
max_return_elements,
nullptr,
word_complete,
matches);
return matches.GetSize();
}
else
{
matches.Clear();
word_complete = false;
}
return 0;
}
示例6: strlen
size_t
OptionValueEnumeration::AutoComplete (CommandInterpreter &interpreter,
const char *s,
int match_start_point,
int max_return_elements,
bool &word_complete,
StringList &matches)
{
word_complete = false;
matches.Clear();
const uint32_t num_enumerators = m_enumerations.GetSize();
if (s && s[0])
{
const size_t s_len = strlen(s);
for (size_t i=0; i<num_enumerators; ++i)
{
const char *name = m_enumerations.GetCStringAtIndex(i);
if (::strncmp(s, name, s_len) == 0)
matches.AppendString(name);
}
}
else
{
// only suggest "true" or "false" by default
for (size_t i=0; i<num_enumerators; ++i)
matches.AppendString(m_enumerations.GetCStringAtIndex(i));
}
return matches.GetSize();
}
示例7: ClearData
inline void ClearData()
{
for(UINT i=0; i<windowData.Num(); i++)
{
windowData[i].strClass.Clear();
windowData[i].strExecutable.Clear();
}
windowData.Clear();
adminWindows.Clear();
}
示例8: HandleArgumentCompletion
int CommandObjectProxy::HandleArgumentCompletion(
Args &input, int &cursor_index, int &cursor_char_position,
OptionElementVector &opt_element_vector, int match_start_point,
int max_return_elements, bool &word_complete, StringList &matches) {
CommandObject *proxy_command = GetProxyCommandObject();
if (proxy_command)
return proxy_command->HandleArgumentCompletion(
input, cursor_index, cursor_char_position, opt_element_vector,
match_start_point, max_return_elements, word_complete, matches);
matches.Clear();
return 0;
}
示例9: IOHandlerComplete
int REPL::IOHandlerComplete(IOHandler &io_handler, const char *current_line,
const char *cursor, const char *last_char,
int skip_first_n_matches, int max_matches,
StringList &matches) {
matches.Clear();
llvm::StringRef line(current_line, cursor - current_line);
// Complete an LLDB command if the first character is a colon...
if (!line.empty() && line[0] == ':') {
Debugger &debugger = m_target.GetDebugger();
// auto complete LLDB commands
const char *lldb_current_line = line.substr(1).data();
return debugger.GetCommandInterpreter().HandleCompletion(
lldb_current_line, cursor, last_char, skip_first_n_matches, max_matches,
matches);
}
// Strip spaces from the line and see if we had only spaces
line = line.ltrim();
if (line.empty()) {
// Only spaces on this line, so just indent
matches.AppendString(m_indent_str);
return 1;
}
std::string current_code;
current_code.append(m_code.CopyList());
IOHandlerEditline &editline = static_cast<IOHandlerEditline &>(io_handler);
const StringList *current_lines = editline.GetCurrentLines();
if (current_lines) {
const uint32_t current_line_idx = editline.GetCurrentLineIndex();
if (current_line_idx < current_lines->GetSize()) {
for (uint32_t i = 0; i < current_line_idx; ++i) {
const char *line_cstr = current_lines->GetStringAtIndex(i);
if (line_cstr) {
current_code.append("\n");
current_code.append(line_cstr);
}
}
}
}
if (cursor > current_line) {
current_code.append("\n");
current_code.append(current_line, cursor - current_line);
}
return CompleteCode(current_code, matches);
}
示例10: False
StringList
For::Evaluate(EvaluationContext& context)
{
// get the loop variable -- we ignore all but the first element of the
// variable list
const StringList& variables = fVariable->Evaluate(context);
if (variables.IsEmpty())
return StringList::False();
// look for a local variable
StringList* variableValue = context.LocalScope()->Lookup(variables.Head());
if (variableValue == NULL) {
// no local variable -- check for a global one
variableValue = context.GlobalVariables()->Lookup(variables.Head());
if (variableValue == NULL) {
// no existing global variable either -- create one
variableValue = &context.GlobalVariables()->LookupOrCreate(
variables.Head());
}
}
// perform the for loop
StringList result;
const StringList& list = fList->Evaluate(context);
for (StringList::Iterator it = list.GetIterator(); it.HasNext();) {
// assign the variable
variableValue->Clear();
variableValue->Append(it.Next());
// execute the block
result = fBlock->Evaluate(context);
// handle jump conditions
switch (context.GetJumpCondition()) {
case JUMP_CONDITION_NONE:
break;
case JUMP_CONDITION_BREAK:
context.SetJumpCondition(JUMP_CONDITION_NONE);
return result;
case JUMP_CONDITION_CONTINUE:
context.SetJumpCondition(JUMP_CONDITION_NONE);
break;
case JUMP_CONDITION_RETURN:
case JUMP_CONDITION_JUMP_TO_EOF:
case JUMP_CONDITION_EXIT:
return result;
}
}
return result;
}
示例11: GetStringList
void XElement::GetStringList(CTSTR lpName, StringList &stringList) const
{
assert(lpName);
stringList.Clear();
for(DWORD i=0; i<SubItems.Num(); i++)
{
if(!SubItems[i]->IsData()) continue;
XDataItem *item = static_cast<XDataItem*>(SubItems[i]);
if(item->strName.CompareI(lpName))
stringList << item->strData;
}
}
示例12: exe_ctx
size_t
OptionValueUUID::AutoComplete (CommandInterpreter &interpreter,
const char *s,
int match_start_point,
int max_return_elements,
bool &word_complete,
StringList &matches)
{
word_complete = false;
matches.Clear();
ExecutionContext exe_ctx(interpreter.GetExecutionContext());
Target *target = exe_ctx.GetTargetPtr();
if (target)
{
const size_t num_modules = target->GetImages().GetSize();
if (num_modules > 0)
{
UUID::ValueType uuid_bytes;
const size_t num_bytes_decoded = UUID::DecodeUUIDBytesFromCString(s, uuid_bytes, NULL);
for (size_t i=0; i<num_modules; ++i)
{
ModuleSP module_sp (target->GetImages().GetModuleAtIndex(i));
if (module_sp)
{
const UUID &module_uuid = module_sp->GetUUID();
if (module_uuid.IsValid())
{
bool add_uuid = false;
if (num_bytes_decoded == 0)
add_uuid = true;
else
add_uuid = ::memcmp(module_uuid.GetBytes(), uuid_bytes, num_bytes_decoded) == 0;
if (add_uuid)
{
std::string uuid_str;
uuid_str = module_uuid.GetAsString();
if (!uuid_str.empty())
matches.AppendString(uuid_str.c_str());
}
}
}
}
}
}
return matches.GetSize();
}
示例13: current_var
size_t
Host::GetEnvironment(StringList &env)
{
// The environment block on Windows is a contiguous buffer of NULL terminated strings,
// where the end of the environment block is indicated by two consecutive NULLs.
LPCH environment_block = ::GetEnvironmentStrings();
env.Clear();
while (*environment_block != '\0')
{
llvm::StringRef current_var(environment_block);
if (current_var[0] != '=')
env.AppendString(current_var);
environment_block += current_var.size()+1;
}
return env.GetSize();
}
示例14: strlen
size_t
OptionValueBoolean::AutoComplete (CommandInterpreter &interpreter,
const char *s,
int match_start_point,
int max_return_elements,
bool &word_complete,
StringList &matches)
{
word_complete = false;
matches.Clear();
struct StringEntry {
const char *string;
const size_t length;
};
static const StringEntry g_autocomplete_entries[] =
{
{ "true" , 4 },
{ "false", 5 },
{ "on" , 2 },
{ "off" , 3 },
{ "yes" , 3 },
{ "no" , 2 },
{ "1" , 1 },
{ "0" , 1 },
};
const size_t k_num_autocomplete_entries = llvm::array_lengthof(g_autocomplete_entries);
if (s && s[0])
{
const size_t s_len = strlen(s);
for (size_t i=0; i<k_num_autocomplete_entries; ++i)
{
if (s_len <= g_autocomplete_entries[i].length)
if (::strncasecmp(s, g_autocomplete_entries[i].string, s_len) == 0)
matches.AppendString(g_autocomplete_entries[i].string);
}
}
else
{
// only suggest "true" or "false" by default
for (size_t i=0; i<2; ++i)
matches.AppendString(g_autocomplete_entries[i].string);
}
return matches.GetSize();
}
示例15:
size_t
OptionValueFileSpec::AutoComplete (CommandInterpreter &interpreter,
const char *s,
int match_start_point,
int max_return_elements,
bool &word_complete,
StringList &matches)
{
word_complete = false;
matches.Clear();
CommandCompletions::InvokeCommonCompletionCallbacks (interpreter,
m_completion_mask,
s,
match_start_point,
max_return_elements,
NULL,
word_complete,
matches);
return matches.GetSize();
}