本文整理汇总了C++中TextFile::getName方法的典型用法代码示例。如果您正苦于以下问题:C++ TextFile::getName方法的具体用法?C++ TextFile::getName怎么用?C++ TextFile::getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextFile
的用法示例。
在下文中一共展示了TextFile::getName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: cp
bool Directory::cp(const File& file) {
// exe ise direk deep-independet copy al
const Executable *temp = dynamic_cast<const Executable *> (&file);
if (temp != NULL) {
Executable *nExe = new Executable(*temp);
nExe->setTime("18/12/15"); // zamanlar temsilidir
nExe->updatePath(this->path() + "/" + nExe->getName()); //path guncelle
m_inFiles.insert(nExe); // containere sirali olarak ekle
}
// klasor ise copy constuctor ile o klasorun deep copy sini al
const Directory *temp1 = dynamic_cast<const Directory *> (&file);
if (temp1 != NULL) {
Directory *nDir = new Directory(*temp1);
nDir->setTime("19/12/15"); // zamanlar temsilidir
nDir->updatePath(this->path() + "/" + nDir->getName()); // path upd.
m_inFiles.insert(nDir);
}
// text dosyasi ise direk copy al
const TextFile *temp2 = dynamic_cast<const TextFile *> (&file);
if (temp2 != NULL) {
TextFile *nText = new TextFile(*temp2);
nText->setTime("21/12/15"); // zamanlar temsilidir
nText->updatePath(this->path() + "/" + nText->getName());
m_inFiles.insert(nText);
}
// dangling pointers
temp = NULL;
temp1 = NULL;
temp2 = NULL;
return true;
}
示例2: main
int main()
{
File f;
f.setName("file");
cout << f.getName() << endl;
cout << f.getSize() << endl;
cout << f.getFileTime();
cout << "#####################################" << endl;
TextFile t;
t.setName("textFile");
t.setCoding(1);
cout << t.getName() << endl;
cout << t.getSize() << endl;
cout << t.getFileTime();
cout << t.getCoding() << endl;
cout << "#####################################" << endl;
IniFile i;
i.setName("iniFile");
i.setCoding(0);
i.setForProgram("QQ");
cout << i.getName() << endl;
cout << i.getSize() << endl;
cout << i.getFileTime();
cout << i.getCoding() << endl;
cout << i.getForProgram() << endl;
cout << "#####################################" << endl;
XmlFile x;
x.setName("xmlFile");
x.setCoding(0);
x.setVersion("1.1.123");
cout << x.getName() << endl;
cout << x.getSize() << endl;
cout << x.getFileTime();
cout << x.getVersion() << endl;
cout << "#####################################" << endl;
BinaryFile b;
b.setName("binaryFile");
b.setInSystem("Linux");
cout << b.getName() << endl;
cout << b.getSize() << endl;
cout << b.getFileTime();
cout << b.getInSystem() << endl;
cout << "#####################################" << endl;
MediaFile m;
m.setName("mediaFile");
m.setInSystem("Mac OS X");
m.setTheQuality(high);
cout << m.getName() << endl;
cout << m.getSize() << endl;
cout << m.getFileTime();
cout << m.getInSystem() << endl;
cout << m.getTheQuality() << endl;
cout << "#####################################" << endl;
ExeFile e;
e.setName("exeFile");
e.setInSystem("Windows");
e.setTheAllRight(administrator);
cout << e.getName() << endl;
cout << e.getSize() << endl;
cout << e.getFileTime();
cout << e.getInSystem() << endl;
cout << e.getTheAllRight() << endl;
cout << "#####################################" << endl;
XmlMediaFile xm;
xm.XmlFile::setName("xmlMediaFile");
xm.setInSystem("Windows");
xm.setCoding(0);
xm.setVersion("2.2.2.222");
xm.setTheQuality(high);
xm.setTheDevice(Windows);
cout << xm.XmlFile::getName() << endl;
cout << xm.XmlFile::getSize() << endl;
cout << xm.XmlFile::getFileTime();
cout << xm.getCoding() << endl;
cout << xm.getInSystem() << endl;
cout << xm.getVersion() << endl;
cout << xm.getTheQuality() << endl;
cout << xm.getTheDevice() << endl;
return 0;
}