Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- `void AddNewMagicItem(const std::string & ItemKey, const std::string & ItemDescription, const std::string &filename)
- {
- const char* ItemKeyName = ItemKey.c_str();
- const char* ItemDescriptionBody = ItemDescription.c_str();
- const char* FileToAddItemTo = filename.c_str();
- std::ofstream AddingItem(FileToAddItemTo);
- std::ifstream FileCheck(FileToAddItemTo);
- AddingItem.open(FileToAddItemTo, std::ios::out | std::ios::app);
- if (_access (FileToAddItemTo, 0) == 0)
- {
- if (FileCheck.is_open())
- {
- AddingItem << ItemKey;
- std::cout << ItemKey << std::endl;
- }
- }
- AddingItem.close(); // not sure these are necessary
- FileCheck.close(); //not sure these are necessary
- }`
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement