| 535 | } |
| 536 | |
| 537 | File::Ptr Directory::get_file(const char* name) |
| 538 | { |
| 539 | if (std::strlen(name) >= FSS_MAX_FILE_NAME) { |
| 540 | throw std::runtime_error("file name too long"); |
| 541 | } |
| 542 | |
| 543 | ACE_TString t_name(ACE_TEXT_CHAR_TO_TCHAR(name)); |
| 544 | Map::iterator it = files_.find(t_name); |
| 545 | |
| 546 | if (it == files_.end()) { |
| 547 | return make_new_file(t_name); |
| 548 | |
| 549 | } else { |
| 550 | return DCPS::make_rch<File>(full_path(it->second), it->first, rchandle_from(this)); |
| 551 | } |
| 552 | } |
| 553 | |
| 554 | File::Ptr Directory::make_new_file(const ACE_TString& t_name) |
| 555 | { |