Moved keywords from local variables to keywords map.
This commit is contained in:
1 parent
907f449ecc
commit
9622b5cf8c
23 files changed
+221
-220
No files matched your search
+4
-4
@@ -7,18 +7,18 @@
|
||||
namespace jet {
|
||||
|
||||
__read::__read(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent, Tag *local) : Tag(in, parentOut, global, parent, this) {
|
||||
if(!variableDefined("file"))
|
||||
if(!keywordDefined("file"))
|
||||
throw coreutils::Exception("file keyword must be specified.");
|
||||
if(!variableDefined("name"))
|
||||
if(!keywordDefined("name"))
|
||||
throw coreutils::Exception("name keyword must be specified.");
|
||||
if(hasContainer)
|
||||
throw coreutils::Exception("read tag does not have a container.");
|
||||
resolveKeyword("file");
|
||||
resolveKeyword("name");
|
||||
fd = open(variables["file"].c_str(), O_RDONLY);
|
||||
fd = open(keywords["file"].c_str(), O_RDONLY);
|
||||
if(fd < 0)
|
||||
throw coreutils::Exception("file name is not found.");
|
||||
global.variables[variables["name"]].read(fd);
|
||||
global.variables[keywords["name"]].read(fd);
|
||||
close(fd);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user