当前位置: 首页>>代码示例>>C++>>正文


C++ MCCStringFree函数代码示例

本文整理汇总了C++中MCCStringFree函数的典型用法代码示例。如果您正苦于以下问题:C++ MCCStringFree函数的具体用法?C++ MCCStringFree怎么用?C++ MCCStringFree使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了MCCStringFree函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: MCHandleSetAllowedOrientations

Exec_stat MCHandleSetAllowedOrientations(void *context, MCParameter *p_parameters)
{
	bool t_success;
	t_success = true;
	
	char *t_orientations;
	t_orientations = nil;
	if (t_success)
		t_success = MCParseParameters(p_parameters, "s", &t_orientations);
	
	char **t_orientations_array;
	uint32_t t_orientations_count;
	t_orientations_array = nil;
	t_orientations_count = 0;
	if (t_success)
		t_success = MCCStringSplit(t_orientations, ',', t_orientations_array, t_orientations_count);
	
	uint32_t t_orientations_set;
	t_orientations_set = 0;
	if (t_success)
		for(uint32_t i = 0; i < t_orientations_count; i++)
			for(uint32_t j = 0; s_orientation_names[j] != nil; j++)
				if (MCCStringEqualCaseless(t_orientations_array[i], s_orientation_names[j]))
					t_orientations_set |= (1 << j);
	
	s_allowed_orientations = t_orientations_set;
	
	for(uint32_t i = 0; i < t_orientations_count; i++)
		MCCStringFree(t_orientations_array[i]);
	MCMemoryDeleteArray(t_orientations_array);
	
	MCCStringFree(t_orientations);
	
	return ES_NORMAL;
}
开发者ID:Bjoernke,项目名称:livecode,代码行数:35,代码来源:mblandroidorientation.cpp

示例2: MCCStringFree

MCReferencedImageRep::~MCReferencedImageRep()
{
	MCCStringFree(m_file_name);
	MCCStringFree(m_search_key);
	
	MCMemoryDeallocate(m_url_data);
}
开发者ID:elphinkuo,项目名称:livecode,代码行数:7,代码来源:image_rep_encoded.cpp

示例3: MCHandleAdSetTopLeft

Exec_stat MCHandleAdSetTopLeft(void *context, MCParameter *p_parameters)
{
	bool t_success;
	t_success = true;
    
    MCExecPoint ep(nil, nil, nil);
    MCExecContext t_ctxt(ep);
	t_ctxt . SetTheResultToEmpty();
    
	char *t_ad;
	t_ad = nil;
    char *t_top_left_string;
    t_top_left_string = nil;
	if (t_success)
		t_success = MCParseParameters(p_parameters, "ss", &t_ad, &t_top_left_string);
    
    MCAdTopLeft t_top_left = {0,0};
    if (t_success)
        t_success = sscanf(t_top_left_string, "%u,%u", &t_top_left.x, &t_top_left.y);
    
	if (t_success)
		MCAdSetTopLeftOfAd(t_ctxt, t_ad, t_top_left);
    
    MCCStringFree(t_top_left_string);
    MCCStringFree(t_ad);
    
    return t_ctxt.GetStat();
}
开发者ID:MichalEuro,项目名称:livecode,代码行数:28,代码来源:mblad.cpp

示例4: MCContactParseParams

bool MCContactParseParams(MCParameter *p_params, MCVariableValue *&r_contact, char *&r_title, char *&r_message, char *&r_alternate_name)
{
	bool t_success = true;
	
	MCVariableValue *t_contact = nil;
	char *t_title = nil;
	char *t_message = nil;
	char *t_alternate_name = nil;
	
	t_success = MCParseParameters(p_params, "a|sss", &t_contact, &t_title, &t_message, &t_alternate_name);
	
	if (t_success)
	{
		r_contact = t_contact;
		r_title = t_title;
		r_message = t_message;
		r_alternate_name = t_alternate_name;
	}
	else
	{
		MCCStringFree(t_title);
		MCCStringFree(t_message);
		MCCStringFree(t_alternate_name);
	}
	
	return t_success;
}
开发者ID:Bjoernke,项目名称:livecode,代码行数:27,代码来源:mblcontact.cpp

示例5: MCSystemProcessUrl

bool MCSystemProcessUrl(const char *p_url, MCSystemUrlOperation p_operations, char *&r_processed_url)
{
    bool t_success = true;

    char *t_processed = nil;

    if (t_success && (p_operations & kMCSystemUrlOperationStrip))
    {
        char *t_stripped = nil;
        t_success = MCSystemStripUrl(t_processed != nil ? t_processed : p_url, t_stripped);
        if (t_success)
        {
            MCCStringFree(t_processed);
            t_processed = t_stripped;
        }
    }

    // if no processing, just return a copy of the input url
    if (t_success && t_processed == nil)
        t_success = MCCStringClone(p_url, t_processed);

    if (t_success)
        r_processed_url = t_processed;
    else
        MCCStringFree(t_processed);

    return t_success;
}
开发者ID:n9yty,项目名称:livecode,代码行数:28,代码来源:mblspec.cpp

示例6: MCSystemPlaySound

bool MCSystemPlaySound(const char *p_file, bool p_looping)
{
	//MCLog("MCSystemPlaySound(%s, %s)", p_file, p_looping?"true":"false");
	bool t_success;
	if (s_sound_file != nil)
	{
		MCCStringFree(s_sound_file);
		s_sound_file = nil;
	}
    
	s_sound_file = MCS_resolvepath(p_file);
    
	const char *t_apk_file = nil;
	if (path_to_apk_path(s_sound_file, t_apk_file))
		MCAndroidEngineCall("playSound", "bsbb", &t_success, t_apk_file, true, p_looping);
	else
		MCAndroidEngineCall("playSound", "bsbb", &t_success, s_sound_file, false, p_looping);
	if (!t_success)
	{
		MCCStringFree(s_sound_file);
		s_sound_file = nil;
	}
    
	return t_success;
}
开发者ID:elphinkuo,项目名称:livecode,代码行数:25,代码来源:mblandroidsound.cpp

示例7: MCTextLayoutLinkedFontDestroy

static void MCTextLayoutLinkedFontDestroy(MCTextLayoutLinkedFont *self)
{
	for(uint32_t i = 0; i < self -> entry_count; i++)
		MCCStringFree(self -> entries[i] . face);
	MCMemoryDeleteArray(self -> entries);
	MCCStringFree(self ->  name);
	MCMemoryDelete(self);
}
开发者ID:Bjoernke,项目名称:livecode,代码行数:8,代码来源:w32textlayout.cpp

示例8: MCCStringFree

void MCUrlProgressEvent::Destroy(void)
{
    MCCStringFree(m_url);
    if (m_status == kMCSystemUrlStatusError)
        MCCStringFree(m_error);
    if (m_object != nil)
        m_object->Release();
    delete this;
}
开发者ID:n9yty,项目名称:livecode,代码行数:9,代码来源:mblspec.cpp

示例9: MCImageRepGetReferencedWithScale

bool MCImageRepGetReferencedWithScale(const char *p_base, const char *p_extension, MCGFloat p_scale, MCImageRep *&r_rep)
{
	bool t_success;
	t_success = true;
	
	MCImageRep *t_rep;
	t_rep = nil;
	
	char *t_default_path;
	t_default_path = nil;
	
	const char **t_labels;
	t_labels = nil;
	
	if (t_success)
		t_success = MCImageGetLabelsForScale(p_scale, t_labels);
	
	// construct default path as base path with first tag for the given scale
	if (t_success)
		t_success = MCCStringFormat(t_default_path, "%s%s%s", p_base, t_labels[0], p_extension);
	
	if (t_success)
	{
		MCCachedImageRep *t_cached_rep;
		t_cached_rep = nil;
		
		if (MCCachedImageRep::FindWithKey(t_default_path, t_cached_rep))
			t_rep = t_cached_rep->Retain();
		// not in cache, so see if default path exists.
		else if (MCS_exists(t_default_path, True))
			t_success = MCImageRepCreateReferencedWithSearchKey(t_default_path, t_default_path, t_rep);
		// else loop through remaining labels and check for matching files
		else
		{
			for (uint32_t i = 1; t_success && t_rep == nil && t_labels[i] != nil; i++)
			{
				char *t_scaled_path;
				t_scaled_path = nil;
				
				t_success = MCCStringFormat(t_scaled_path, "%s%s%s", p_base, t_labels[i], p_extension);
				
				if (t_success && MCS_exists(t_scaled_path, True))
					t_success = MCImageRepCreateReferencedWithSearchKey(t_scaled_path, t_default_path, t_rep);
				
				MCCStringFree(t_scaled_path);
			}
		}
	}
	
	MCCStringFree(t_default_path);
	
	if (t_success)
		r_rep = t_rep;
	
	return t_success;
}
开发者ID:runrevelanor,项目名称:livecode,代码行数:56,代码来源:image_rep_densitymapped.cpp

示例10: delete_custom_font

static void delete_custom_font(MCAndroidCustomFont *p_font)
{
    if (p_font != nil)
    {
        /*UNCHECKED */ MCCStringFree(p_font->path);
        /*UNCHECKED */ MCCStringFree(p_font->name);
        /*UNCHECKED */ MCCStringFree(p_font->family);
        /*UNCHECKED */ MCMemoryDelete(p_font);
    }
}
开发者ID:Bjoernke,项目名称:livecode,代码行数:10,代码来源:mblandroidfont.cpp

示例11: cgi_dispose_multipart_context

static void cgi_dispose_multipart_context(cgi_multipart_context_t *p_context)
{
	MCCStringFree(p_context->name);
	MCCStringFree(p_context->file_name);
	MCCStringFree(p_context->type);
	MCCStringFree(p_context->boundary);
	if (p_context->file_handle != NULL)
		MCS_close(p_context->file_handle);
	
	MCMemoryClear(p_context, sizeof(cgi_multipart_context_t));
}
开发者ID:bduck,项目名称:livecode,代码行数:11,代码来源:srvcgi.cpp

示例12: MCSessionDisposeSession

void MCSessionDisposeSession(MCSession *p_session)
{
	if (p_session == NULL)
		return;
	
	MCCStringFree(p_session->id);
	MCCStringFree(p_session->ip);
	MCCStringFree(p_session->filename);

	MCMemoryDeallocate(p_session->data);
	
	MCMemoryDelete(p_session);
}
开发者ID:alilloyd,项目名称:livecode,代码行数:13,代码来源:srvsession.cpp

示例13: MCFileSystemListEntries

bool MCFileSystemListEntries(const char *p_folder, uint32_t p_options, MCFileSystemListCallback p_callback, void *p_context)
{
	bool t_success = true;
	
	char *t_resolved_path = nil;
	DIR *t_dir = nil;
	t_success = MCFileSystemPathResolve(p_folder, t_resolved_path);
	
	if (t_success)
	{
		t_dir = opendir(t_resolved_path);
		t_success = t_dir != nil;
	}
	
	if (t_success)
	{
		struct dirent *t_entry = nil;
		struct stat t_entry_stat;
		MCFileSystemEntry t_fs_entry;
		while (t_success && nil != (t_entry = readdir(t_dir)))
		{
			if (!MCCStringEqual(t_entry->d_name, ".") && !MCCStringEqual(t_entry->d_name, ".."))
			{
				char *t_child_path = nil;
				t_success = MCCStringFormat(t_child_path, "%s/%s", t_resolved_path, t_entry->d_name);
				if (t_success)
					t_success = -1 != lstat(t_child_path, &t_entry_stat);
				MCCStringFree(t_child_path);
				if (t_success)
				{
					t_fs_entry.filename = t_entry->d_name;
					if (S_ISLNK(t_entry_stat.st_mode))
						t_fs_entry.type = kMCFileSystemEntryLink;
					else if (S_ISDIR(t_entry_stat.st_mode))
						t_fs_entry.type = kMCFileSystemEntryFolder;
					else
						t_fs_entry.type = kMCFileSystemEntryFile;
					
					t_success = p_callback(p_context, t_fs_entry);
				}
			}
		}
		closedir(t_dir);
	}
	MCCStringFree(t_resolved_path);
	
	return t_success;
}
开发者ID:alilloyd,项目名称:livecode,代码行数:48,代码来源:filesystem.cpp

示例14: look_up_custom_font

static MCAndroidCustomFont* look_up_custom_font(const char *p_name, bool p_bold, bool p_italic)
{
    char *t_styled_name;
    t_styled_name = nil;    
    if (!MCCStringClone(p_name, t_styled_name))
        return nil;    
    if (p_bold && !MCCStringAppend(t_styled_name, " Bold"))
        return nil;
    if (p_italic && !MCCStringAppend(t_styled_name, " Italic"))
        return nil;    
    
    // Fist of all, attempt to look the font up by taking into account its name and style.
    // e.g. textFont:Arial textStyle:Bold - look for a font named Arial Bold.
    // This will fail for textFonts which include style information e.g. textFont:Arial textStyle:Bold will search for Arial Bold Bold
    MCAndroidCustomFont *t_font;
    t_font = look_up_custom_font_by_name(t_styled_name);
    /*UNCHECKED */ MCCStringFree(t_styled_name);
    if (t_font != nil)
        return t_font;
    
    // If no font found, look up based purley on the name.  This will solve cases where style
    // information is included in the name e.g. Arial Bold.
    if (p_bold || p_italic)
    {
        t_font = look_up_custom_font_by_name(p_name);
        if (t_font != nil)
            return t_font;
    }
    
    // If we've still not found a matching font, look up based on the family and style.
    // This function will attempt to provide a closest match e.g. Arial Bold is requested but only Arial is installed.
    t_font = look_up_custom_font_by_family_and_style(p_name, p_bold, p_italic);
    return t_font;
}
开发者ID:Bjoernke,项目名称:livecode,代码行数:34,代码来源:mblandroidfont.cpp

示例15: fetch_cstring_array

static Exec_stat fetch_cstring_array(MCExecPoint& ep, MCVariableValue *array, const char *key, char**& r_strings, uint32_t& r_string_count)
{
	bool t_success;
	t_success = true;
	
	char *t_strings_list;
	t_strings_list = nil;
	if (t_success)
		if (fetch_opt_cstring(ep, array, key, t_strings_list) == ES_ERROR)
			t_success = false;
	
	char **t_strings;
	uint32_t t_string_count;
	t_strings = nil;
	t_string_count = 0;
	if (t_success)
		t_success = MCCStringSplit(t_strings_list, '\n', t_strings, t_string_count);
	
	if (t_success)
	{
		r_strings = t_strings;
		r_string_count = t_string_count;
	}
	
	MCCStringFree(t_strings_list);
	
	return t_success ? ES_NORMAL : ES_ERROR;
	
}
开发者ID:Bjoernke,项目名称:livecode,代码行数:29,代码来源:deploy.cpp


注:本文中的MCCStringFree函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。