|
|
#include <acdk/io/File.h>
using namespace ::acdk::lang;
using namespace ::acdk::io;
bool foo()
{
RString str = "./temp.file";
RFile file = new File(str);
return file->exists();
}
|
using declaration
#include <acdk/io/File.h>
using ::acdk::lang::RString;
using ::acdk::io::File;
using ::acdk::io::RFile;
bool foo()
{
RString str = "./temp.file";
RFile file = new File(str);
return file->exists();
}
|
#include <acdk/io/File.h>
// using now String, RString, StringArray and RStringArray
USING_CLASS(::acdk::lang::, String);
// using now File, RFile, FileArray, RFileArray
USING_CLASS(::acdk::io::, File);
bool foo()
{
RString str = "./temp.file";
RFile file = new File(str);
return file->exists();
}
|
Creating own namespaces
// this is myapp/src/com/artefaktur/myapp/MyClass.h
#ifndef com_artefaktur_myapp_MyClass_h
#define com_artefaktur_myapp_MyClass_h
namespace com {
namespace artefaktur {
namespace myapp {
class MyClass
: extends acdk::lang::Object
{
// ...
};
} // namespace myapp
} // namespace artefaktur
} // namespace com
#endif //com_artefaktur_myapp_MyClass_h
|