| 670 | } |
| 671 | |
| 672 | void CustomFunctionInjector::ExtendStoryHeader(std::wstring const & headerPath) |
| 673 | { |
| 674 | extendingStory_ = true; |
| 675 | |
| 676 | #if 0 |
| 677 | DEBUG("CustomFunctionInjector::ExtendStoryHeader(): Appending to header:\r\n"); |
| 678 | OutputDebugStringA(headers.c_str()); |
| 679 | std::cout << headers << std::endl; |
| 680 | #endif |
| 681 | |
| 682 | auto headers = functions_.GenerateHeaders(); |
| 683 | std::ofstream wf(headerPath.c_str(), std::ios::out | std::ios::binary | std::ios::app); |
| 684 | wf.write(headers.data(), headers.size()); |
| 685 | wf.close(); |
| 686 | |
| 687 | #if !defined(OSI_EOCAPP) |
| 688 | // Workaround to Windows Defender keeping the file open while |
| 689 | // the editor is trying to read the generated headers |
| 690 | Sleep(100); |
| 691 | #endif |
| 692 | |
| 693 | extendingStory_ = false; |
| 694 | } |
| 695 | |
| 696 | void CustomFunctionInjector::AddJunkToStory(std::wstring const& storyPath) |
| 697 | { |
nothing calls this directly
no test coverage detected