⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 global.cpp

📁 手机归属地数据文件格式是自己定义的
💻 CPP
字号:
/************************************************************
手机号归属地数据导入及查询工具源代码(C++)
  Author: rssn
  Email : rssn@163.com
  QQ    : 126027268
  Blog  : http://blog.csdn.net/rssn_net/
 ************************************************************/

#include <stdio.h>
#include <string.h>
#include "Global.h"

StringNode::StringNode(const char * val)
{
	this->length=strlen(val);
	this->value=new char[this->length+1];
	strcpy(this->value,val);
	this->next=NULL;
}
StringNode::StringNode()
{
	value=NULL;
	length=0;
	next=NULL;
}
StringNode::~StringNode()
{
	if(value) delete[] value;
}

IndexNode::IndexNode()
{
	NumStart=NumEnd=0;
	Address=NULL;
	next=NULL;
}
IndexNode::IndexNode(int ns, int ne, StringNode * ad)
{
	NumStart=ns; NumEnd=ne; Address=ad;
	next=NULL;
}

char * ChangeFileExt(const char * fn, const char * fext)
{
	int l=strlen(fn);
	int le=strlen(fext);
	for(int i=l-1; fn[i]!='.' && fn[i]!='\\' && fn[i]!='/' && fn[i]!=':' && i>=0; i--);
	char * fnext;
	//如果没扩展名
	if(i<=0||fn[i]=='\\'||fn[i]=='/'||fn[i]==':')
	{
		fnext=new char[l+le+2];
		strcpy(fnext,fn);
		fnext[l]='.';
		l++;
		strcpy(fnext+l,fext);
	}
	else
	{
		l=i+1;
		fnext=new char[l+le+1];
		strcpy(fnext,fn);
		strcpy(fnext+l,fext);
	}
	//申请新文件名的存储空间
	return fnext;
}

bool IsNumeric(const char * val)
{
	for(int i=0;val[i]!='\0';i++)
	{
		if(val[i]<'0'||val[i]>'9')
			return false;
	}
	return true;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -