/** 辞書ロード */ bool ImeServer::loadDictionary() { MonAPI::scoped_ptr<MonAPI::SharedMemory> shm(monapi_file_read_all(BASICDIC_NAME)); if (shm.get() != NULL) { basicDicSize = shm->size(); if (basicDicSize > 0) { basicDic = (char *)malloc(basicDicSize); memcpy(basicDic, shm->data(), basicDicSize); } return true; } else { return false; } }
/** @brief 説明、引数、戻り値はMonapi2リファレンス参照。 @date 2005/08/20 junjunn 作成 @date 2005/09/20 junjunn 実装 */ bool FileFn::read(cpchar1 cszPath,uint8_t* pBufferOut,int iBufferSize) { #ifdef MONA monapi_cmemoryinfo* pMemoryInfo = monapi_file_read_all(cszPath); if (! pMemoryInfo) return false; MemoryFn::copy(pBufferOut,pMemoryInfo->Data,pMemoryInfo->Size); return true; #else FILE* p=fopen(cszPath,"r"); fread(pBufferOut,sizeof(uint8_t),iBufferSize,p); fclose(p); return true; #endif return false; }