string不是std的成员????
深渊丶唤雨 2017-03-31 02:44:17 // NodewebFO.cpp : 定义控制台应用程序的入口点。
//
#include<iostream>
#include<string>
#include "stdafx.h"
//#include "DLLprocess.h"
using namespace std;
class OutCal
{
public:
OutCal(int L,int C,int R,std::string f);
~OutCal();
int GL();
int GC();
int GR();
std::string GF();
std::string Gfilenamex();
std::string Gfilenamee();
private:
int Level;
int Col;
int Row;
std::string from;
std::string r;
std::string c;
std::string l;
};
OutCal::OutCal(int L, int C, int R, std::string f)
{
Level = L;
Col = C;
Row = R;
from = f;
char strl[3];
sprintf(strl, "%d", Level);
int lLength = strlen(strl);
l = strl;
if (lLength < 2) {
for (int i = 0; i < 2 - lLength; i++) {
l = "0" + l;
}
}
l = "L" + l;
const char* Charl = l.c_str();
int rGroup = 128 * (Row / 128);
char strr[5];
sprintf(strr, "%x", rGroup);
int rLength = strlen(strr);
r = strr;
if (rLength < 4) {
for (int i = 0; i < 4 - rLength; i++) {
r = "0" + r;
}
}
r = "R" + r;
int cGroup = 128 * (Col / 128);
char strc[5];
sprintf(strc, "%x", cGroup);
c = strc;
int cLength = strlen(strc);
if (cLength < 4) {
for (int i = 0; i < 4 - cLength; i++) {
c = "0" + c;
}
}
c = "C" + c;
}
OutCal::~OutCal()
{
}
int OutCal::GL()
{
return Level;
}
int OutCal::GC()
{
return Col;
}
int OutCal::GR()
{
return Row;
}
std::string OutCal::GF()
{
return from;
}
std::string OutCal::Gfilenamex()
{
return from + "/" + l + "/" + r + c + ".bundlx";
}
std::string OutCal::Gfilenamee()
{
return from + "/" + l + "/" + r + c + ".bundle";
}
int main()
{
OutCal OC(2, 6863, 1374, "_alllayers");
cout << OC.Gfilenamee() << endl;
cout << OC.Gfilenamex() << endl;
return 0;
}