YSRESULT FsGuiCopyStringFromClipBoard(YsString &str) { const int bufLen=FsGuiGetStringLengthInClipBoardC(); if(0<bufLen) { YsArray <char> copyBuf; copyBuf.Set(bufLen+1,NULL); FsGuiCopyStringFromClipBoardC(copyBuf); str.Set(copyBuf); } else { str.Set(""); } return YSOK; }
YSRESULT YsSpecialPath::GetUserDir(YsString &path) { char buf[bufSize]; if(true==YsSpecialPath_GetUserDir(bufSize,buf)) { path.Set(buf); return YSOK; } return YSERR; }
YSRESULT YsSpecialPath::GetProgramFileName(YsString &path) { char buf[bufSize]; if(true==YsSpecialPath_GetProgramFileName(bufSize,buf)) { path.Set(buf); return YSOK; } return YSERR; }
YSRESULT YsSpecialPath::GetUserDir(YsString &path) { const char *homeDir=getenv("HOME"); if(NULL!=homeDir) { path.Set(homeDir); return YSOK; } return YSERR; }
YSRESULT YsSpecialPath::GetProgramFileName(YsString &path) { int n; char buf[MaxPath]; n=readlink("/proc/self/exe",buf,MaxPath-1); if(0<=n) { buf[n]=0; path.Set(buf); return YSOK; } return YSERR; }