2006-01-01ãã1ã¶æéã®è¨äºä¸è¦§
Windowsã®å ´åãUTF-8ã§ãã¹åãæã¤ããã«æ¸ãæãã¦ã¿ãã http://www89.sakura.ne.jp/~janus/distribution/boost_filesystem_utf8.zip path_posix_windows.cppã®ã»ãã¯æ¸ãæããä½ç½®ãã¢ã¹ã¿ãªã¹ã¯é£æã³ã¡ã³ãã§å²ã£ã¦ããã®ã§ãæ°ã«ãªãæ¹ã¯æ¤ç´¢ããªãâ¦
ãªãã ãæè¿åå¾3æãããã«ãªãã¨ççã«ç ããªãããã®ç æ°ãçµæ¥ç¶ãã®ã§ãã¾ãä½æ¥ãã¯ãã©ããªããæ¥ç æãè¦ããã£ã¦ããæç¯ã§ããªãããã«ãã©ãã«ããªããªããã®ãã¨æãã¤ã¤ãæ°ç ãããã¼ããã¨ã«ããã
ã¨ããããboost::filesystemã«UTF-8ãçªã£è¾¼ãã§ããã¡ã¤ã«æä½ãè¡ã段éã§å¦çç³»ããã©ã«ãæåã³ã¼ãã«å¤æããªãããã¨ããæ¹åã§åé¡ãªãããã ããoperation.hppã«å®ç¾©ããã¦ãããã¡ã¤ã«æä½é¢æ°ã使ããªãã®ã¯ã¤ã¿ã¤ã®ã§ãm_path_append()ã§UTF-8ã¨â¦
boost::filesytem::pathã«UTF-8æååãçªã£è¾¼ããã¨èãããã¬ããããUTF-8é¢é£ã®å¤æé¢æ°ãカï¾ï¾ï½ºï¾ï¾ã¨æ¸ãã¦ããããã¹ãï¼ã¨ãã段éã«ãªã£ã¦UTF-8ã§ã¯ãã¡ã¤ã«ãªã¼ãã³ã¨ãåºæ¥ãªããã¨ã«æ°ä»ãã(ãããªãã¨mblen()ãããã§ãã«ããã¤ãåã調ã¹ãªããèªâ¦
C++ã¨ãã¦ã½ã¼ã¹ãã¡ã¤ã«ãã³ã³ãã¤ã«ããéã__cplusplusãå®ç¾©æ¸ã¿ãã¯ãã¨ãã¦å®ç¾©ããã¦ããããã ããC/C++ãªãã¡ã¬ã³ã¹ã®å®ç¾©æ¸ã¿ãã¯ãã®ãã¼ã¸ãä¿¡ç¨ãã¦ãã¨ããã_cplusplusã®é¨åãã³ããã㦠#ifdef _cplusplus // æ£ç¢ºã«ã¯ __cplusplus extern â¦
æåã³ã¼ãã«ã¤ãã¦æ©ãã®ãããã¦ãコï¾ï¾ï½ºï¾ï¾ã¨ã³ã¼ãã£ã³ã°ãããã¨ã«ãããUTF-8ã®manpageã¨RFC3629æ¥æ¬èªè¨³ãåèã«ãã¦UCS-4-->UTF-8ã¸ã®ã¨ã³ã³ã¼ãã£ã³ã°ã«ã¼ãã³ã /* ä¸æåã®UCS-4ãUTF-8ãªã¯ãããåã«ã¨ã³ã³ã¼ããã */ size_t ucs4_to_utf8(char * â¦
Unicodeã®å©ããåããã®ãç¾å®çãã¤å¸¸èçãã¨ããããæãã¤ããããªã¢ããã¼ãã¯ã æååã®å é¨è¡¨ç¾ã¯ã¯ã¤ãæåãå ¥åºåã¯ãã«ããã¤ãæå å é¨è¡¨ç¾ã»å ¥åºåã¨ãã«ãã«ããã¤ãæå ã®2ç¹ãå é¨è¡¨ç¾ã«ã¯ã¤ãæåã使ãå ´åã2byteããå²ãã¦ããªãå¦â¦
æ¨æ¥è¨ã£ã¦ããã«ããã¤ãæååã®é·ããã¯ããæ¹æ³ãmblen()ã使ãã°ç°¡åã«åºæ¥ããã£ã¦ãããmbãªãããç³»ã®é¢æ°ã£ã¦ãã¤ã®ã¾ã«Cæ¨æºã«ï¼(ã int mbstrlen(const char * src) { unsigned length = 0; /* è¿ãå¤ã¨ãªãlength */ const char * psrc = src; /â¦
å é¨è¡¨ç¾ãã¯ã¤ãæåã§ãå ¥åºåããã«ããã¤ãæåã§è¡ãããã®é¢æ°ãå®ç¾©ãã¦ã¿ããé·ããã©ã»ã¨ãã©ã³ã¡ã³ããªã®ã§åå¼ã #include <cstdlib> #include <cassert> #include <string> #include <vector> #include <iostream> #include <locale> #include <stdexcept> #ifdef _MSC_VER #define NS_STD #else #define NS_STD </stdexcept></locale></iostream></vector></string></cassert></cstdlib>â¦
ã³ã³ãã¤ã©ãã¨ã«å®ç¾©ããã¦ããã·ã³ãã«ã#ifdefçã§èª¿ã¹ã¦ãåå¥ã«ã³ã¼ããæ¸ãã¦ããã°ãããããã§è¨ã£ã¦ããã³ã³ãã¤ã©ãã¨ã«å®ç¾©ããã¦ããã·ã³ãã«ãã«é¢ãã¦ã¯ã boost/config/select_compiler_config.hppã§èª¿ã¹ã boost/config/select_compiler_conâ¦
çã«ã¯ã¼ã«ãã¯ã¤ããªã移æ¤æ§ã®ããããã°ã©ã ãæ¸ããã¨ããã¨UCS-4ãããã«Han Unificationãªããããã«ä¸çã®å ¨æåãè©°ãè¾¼ãã§ãã©ãã³æåã ããã¨æ¼¢åã ããã¨4byteã§æ¸ã¾ãã¾ããããã£ã¤ã¼ã®ãå¹³çãã¤ç°¡åã ã¨æããæåã«ã¯æåãå«ã¾ãã¦ãããâ¦
ã¯ã¤ãæå ãã«ããã¤ãæå ã¯ã¤ãæåãæ±ãããã®éå · ã¯ã¤ãæåãã«ããã¤ãæåå¤æã®ããã®é¢æ°ã»APIã Cæ¨æº stdlib.h mbtowc() wctomb() mbstowcs() wcstombs() wchar.h mbrtowc() wcrtomb() mbsrtowcs() wcsrtombs() Windows API MultiByteToWideâ¦
調ã¹ã¦ããããããããã£ã¦ããã®ã§ã¾ã¨ãã Unicode Home Page 使ãããªããã¦ãã³ã¼ã Unicode : The universal character encoding (æã¯)16bitã«å ¨ã¦ã®æåãè©°ãè¾¼ããã¨ããæåéåãå½ç¶65536åã«å ¨ä¸çã®æåãåã¾ãã¯ãã¯ãªãã®ã§Han Unificatioâ¦
ä»æ´ãªãã空ã®è»è·¡SCã®æ å ±ãä»å ¥ãã¦ãããã¤ãã§ã«äºåã ã¼ãã¼ãè¦ããããã¼ãçãä¸ãæ¹å端ãããªãããããããçéãã®ã£ã¦æè¿ãããã¾ãè¦ãªãããããå§ãã¡ããã¨çé¢ç®ã«ãã£ã¡ãããã ããª(ç¬ãé£ç©ºèã§ã®ç©ºæ¦ã·ã¼ã³ãLast Exileã«ä¼¼ã¦ãã¨ãâ¦
ä¾å¤ã£ã¦ä½¿ã£ã¦ã¿ãã®ã«åæ°ããããæ°ããããä¸åä¾å¤ãæããããã¨ãèªåã®æ¸ããå¦çãå ¨ã¦ãã£é£ã°ãã¦ã©ããã¸é£ãã§ãã£ã¦ãã¾ãæ°ãããããã ãå®éã«çºçããå¯è½æ§ã®ããã¨ãããtry-catchãããã¯ã§å²ã£ã¦ãããªãã¨æ¬å½ã«å½¼æ¹ã¸é£ãã§ãã£ã¦ãâ¦
ãã®é ã¯ããªãå®è£ ã«æ ã£ã話ããªã®ã§æ¬¡ãã¼ã¸ã§ã³ã§ç¶æ³ãå¤ãããã¨ããããããã¾ã§ãnativeã®æå³ãã¯ããã¨ããã³ã³ãã¯ã¹ãã§èªãã§ããããããç´°ãã説æããã¨name_checkã¯åºæ¬çã«ãã¡ã¤ã«åã®ã¿ã®ãã§ãã¯ããããã®ã¨ãã¦å®ç¾©ããã¦ãããå ·ä½â¦
boost::filesystemã¯ã¯ã¤ãæåãæ±ããªãã¨æ¸ããã®ã¨é£åãã¦ãä»åã¯æ¥æ¬èªã«éã£ããªããã·ã æåã³ã¼ã C++ã§ããã°ã©ãã³ã°ããéã®è©±ããªã®ã§å¿ ç¶çã«æåã³ã¼ãã«ã¤ãã¦ã®ç¥èãå¿ è¦ãã¨ãããã¨ã«ãªããã ããã¨ããããã æ¥æ¬èªã¨æåã³ã¼ã æâ¦
ã¦ãããâã®æç« æ¯é¢æ» è£ã ãªãä¸å¿èªåã®æèãã¾ã¨ããããã®ã¡ã¢ã¨ãã¦æ¸ãã¦ã¿ããã ãã©ãä¹ ãã¶ãã«ãããããã¨ããã¨ä¸æããããªãã(ããããããä½ãè¨ãããã®ãããããªããorzã¾ãç¦ããªãã§ãã£ã¦ã¿ã¾ããã¼ã
åæãåãã¿ã¤ãã³ã°ãã©ãã¨ããã話ãã§ã¯ãªãã¦ã以åWindowsã®æ¨æºC++ã©ã¤ãã©ãªã§ã¯ctimeãincludeãããåå空éãééã£ã¦ãããã¨æ¸ããããã©ãããããããããã¦ãWindowsã§æéãæ±ãããã°ã©ã ãããå ´åã¯APIã使ã£ãã»ããããã¨ããæ ¹æ ãâ¦
以åboost::filesystemãã©ããªæåãããã試ãããã«ããã£ã¬ã¯ããªãå帰çã«æ¢æ»ãã¦ãã£ã¦ãã£ã¬ã¯ããªã»ãã¡ã¤ã«åã表示ããã¨ããããã°ã©ã ãæ¸ãããã ããããã0x5cåé¡ãã¹ã«ã¼ãã¦ãããã¨ã«æ°ä»ãããã½ã¼ã¹ã¯ä»¥ä¸ã #include <boost/filesystem/path.hpp> #include <boost/filesystem/operations.hpp> #in</boost/filesystem/operations.hpp></boost/filesystem/path.hpp>â¦
boost::filesystemã§ã¾ããå¼ã£ãããç¹ãã端çã«è¨ã£ã¦ãã¾ãã°boost::filesystemã§ã¯ã¯ã¤ãæåãæ±ããªããã£ã¦ãã¨ãªãã ãã©ãã®èª¬æãFAQã«ä»¥ä¸ã®ããã«è¼ã£ã¦ããã®ã§å¼ç¨ã Wide-character names would provide an illusion of portability where pâ¦
以åãããããã¨ãã§ãç·ã¨èã£ã±ã¨ããã¤ã¡ã¼ã¸ã§ãã¶ã¤ã³ãã¦ããã®ã§ãã¨ããããhatena-leafããã¼ãã«é¸ãã ããã ãã©ããããã¤å¹ çããpreè¦ç´ ã§å¹ ãè¶ éããã¨ãµã¤ããã¼ã®æµãè¾¼ã¿ã失æãããã§ã¡ãã£ã¨æ±ãã«ããã£ãã®ã§ãã¡ããã¡ããã¨cssãâ¦
ã³ã³ã¹ãã©ã¯ã¿å ã§ä¾å¤ãéåºããå±éºæ§ã«ã¤ãã¦ãã£ã¨èª¿ã¹ã¦ã¿ãã¨ããã C MAGAZINE ããã°ã©ãã³ã°ã®ç¦ãæWebç C++ç·¨ - ä¾å¤ã«é¢ãããã¿ã¼ã³ cppll:3217 ã³ã³ã¹ãã©ã¯ã¿ã«ã¤ã㦠ã®äºã¤ã大ä½ã®ã¨ããã ã¨æããã ããã©ã£ã¡ã空éçè³æºã«ã¤ãã¦ããâ¦
ãã¨ã®ãããããã¨ãã§æãã¦ãã¢ããã»ã¨ãã©åé¤ãã¦æ²ç¤ºæ¿ã¨ãã£ã¡ã¸ã®ãªã³ã¯ã®ã¿ã«ããããã§ã¾ãç¾ç¶ã®çæ´»ã ã¨å¥ã«ãã£ã¹ã¯ã¹ãã¼ã¹ãå¿ è¦ã£ã¦ããã§ã¯ãªãããæ®ããæ²ç¤ºæ¿ãæ°é±éã«ä¸åº¦æ¸ãè¾¼ã¾ãããã¼ã¹ãªã®ã§ããªãç¡é§ãã§ãå¼ãæãã«ãã¦ãâ¦
C++çtime.hãã¨ãããã»ã¨ãã©ã®å®è£ ã§ã¯ctimeããããã¡ã¤ã«å ã§time.hãstdåå空éå ã«includeãã¦ãããããºãªã®ã ããVC++6.0ã§ã¯ä½æ ãstdåå空éã§ã¯ãªãã°ãã¼ãã«åå空éã«includeããã¦ããã(ææ°ã®Microsoft Platform SDKã§ãã°ãã¼ãã«ååâ¦
ã¤ãããæ¥è¨ãã¡ã¢ãæ²ç¤ºæ¿(ãããèªåã§ä½ã£ãã·ã§ãã¤ãã¤)ã«æ稿ããçæ´»ã¯ã©ããªã®ãï¼ã¨ãããã¨ã§ã¯ã¦ãªãããã¯ããã¦ã¿ãããã£ã¨ä½¿ãæ¹è¦ã¦ã¿ããã ãã htmlãã¼ã¹ Wikiãã¼ã¹ï¼(ãã¤ãã³ã§ulã¨ã) Texãã¼ã¹ ã§æç« ãæ¸ããã®ããä¸äºã¤ã¯ã¨ããâ¦