• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ MCCStringFree函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: MCCStringReplace

void MCCStringReplace(char *&src, char *&dest)
{
    if (dest != NULL)
        MCCStringFree(dest);
    dest = src;
    src = NULL;
}
开发者ID:alilloyd,项目名称:livecode,代码行数:7,代码来源:mblandroidstore.cpp


示例17: MCS_loadurl_callback

static bool MCS_loadurl_callback(void *p_context, MCSystemUrlStatus p_status, const void *p_data)
{
    MCSLoadUrlState *context;
    context = static_cast<MCSLoadUrlState *>(p_context);

    context -> status = p_status;

    if (p_status == kMCSystemUrlStatusError)
        MCMemoryDelete(context->data.bytes);
    else if (p_status == kMCSystemUrlStatusLoading)
    {
        const MCString *t_data = static_cast<const MCString*>(p_data);
        MCMemoryReallocate(context->data.bytes, context->data.size + t_data->getlength(), context->data.bytes);
        MCMemoryCopy(static_cast<uint8_t*>(context->data.bytes) + context->data.size, t_data->getstring(), t_data->getlength());
        context->data.size += t_data->getlength();
    }

    send_url_progress(context -> object, p_status, context -> url, context -> data . size, context -> total, (const char *)p_data);

    if (p_status == kMCSystemUrlStatusError || p_status == kMCSystemUrlStatusFinished)
    {
        MCUrlLoadEvent *t_event;
        t_event = MCUrlLoadEvent::CreateUrlLoadEvent(context->object, context->message, context->url, p_status, context->data.bytes, context->data.size, static_cast<const char *>(p_data));
        if (t_event)
            MCEventQueuePostCustom(t_event);
        context->object->Release();
        MCCStringFree(context->url);
        MCNameDelete(context->message);
        MCMemoryDelete(context);
    }
    return true;
}
开发者ID:n9yty,项目名称:livecode,代码行数:32,代码来源:mblspec.cpp


示例18: __MCGContextMeasurePlatformText

MCGFloat __MCGContextMeasurePlatformText(MCGContextRef self, const unichar_t *p_text, uindex_t p_length, const MCGFont &p_font, const MCGAffineTransform &p_transform)
{	
	//if (!MCGContextIsValid(self))
	//	return 0.0;
	
	bool t_success;
	t_success = true;	
	
	char *t_text;
	t_text = nil;
	if (t_success)
		t_success = MCCStringFromUnicodeSubstring(p_text, p_length / 2, t_text);
	
	MCGFloat t_width;
	t_width = 0.0;
	if (t_success)
	{
		SkPaint t_paint;
		t_paint . setTextSize(p_font . size);
		
		SkTypeface *t_typeface;
		t_typeface = (SkTypeface *) p_font . fid;
		t_paint . setTypeface(t_typeface);
		
		// MM-2013-12-05: [[ Bug 11527 ]] Make sure we calculate the UTF-8 string length correctly.
		uindex_t t_length;
		t_length = MCCStringLength(t_text);
		t_width =  (MCGFloat) t_paint . measureText(t_text, t_length);
    }
	
	MCCStringFree(t_text);
	//self -> is_valid = t_success;
	return t_width;
}
开发者ID:kant,项目名称:livecode,代码行数:34,代码来源:mblandroidtext.cpp


示例19: grab_string

static void inline grab_string(char *&x_dest, char *&x_src)
{
	if (x_dest != NULL)
		MCCStringFree(x_dest);
	x_dest = x_src;
	x_src = NULL;
}
开发者ID:bduck,项目名称:livecode,代码行数:7,代码来源:srvcgi.cpp


示例20: MCS_loadurl

void MCS_loadurl(MCObject *p_object, const char *p_url, const char *p_message)
{
    bool t_success = true;
    MCSLoadUrlState *t_state = nil;
    char *t_processed = nil;
    MCNameRef t_message = nil;
    t_success = MCMemoryNew(t_state) &&
                MCSystemProcessUrl(p_url, kMCSystemUrlOperationStrip, t_processed) &&
                MCNameCreateWithCString(p_message, t_message);

    if (t_success)
    {
        t_state->url = t_processed;
        t_state->message = t_message;
        t_state->status = kMCSystemUrlStatusNone;
        t_state->object = p_object -> gethandle();
        t_state->data . bytes = nil;
        t_state->data . size = 0;

        t_success = MCSystemLoadUrl(t_processed, MCS_loadurl_callback, t_state);
    }

    if (t_success)
        MCresult->clear();
    else
    {
        MCCStringFree(t_processed);
        MCNameDelete(t_message);
        MCMemoryDelete(t_state);
        MCurlresult -> clear();
        MCresult->sets("error: load URL failed");
    }
}
开发者ID:n9yty,项目名称:livecode,代码行数:33,代码来源:mblspec.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ MCG_C1_CLKS函数代码示例发布时间:2022-05-30
下一篇:
C++ MCA_SPML_CALL函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap