OSDN Git Service

修正
[sdl2referencejp/sdl2referencejp.git] / SDL_GetPrefPath.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html lang="ja-JP">
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
5 <meta http-equiv="Content-Style-Type" content="text/css">
6 <meta name="keywords" content="Simple Directmedia Layer SDL2.0">
7 <link rel="top" href="index.html" title="\83z\81[\83\80">
8 <link rel="parent" href="CategoryFileSystem.html" title="1\82Â\8fã">
9 <title>SDL_GetPrefPath</title>
10 </head>
11 <body>
12 <a href="index.html">\96Ú\8e\9f</a> - <a href="ApiByCategory.html">API(\8b@\94\\95Ê)</a> - <a href="CategoryFileSystem.html">\83t\83@\83C\83\8b\83V\83X\83e\83\80</a> - SDL_GetBasePath
13 <hr>
14 <h1>SDL_GetPrefPath</h1>
15 \81u\83v\83\8a\83t\83@\83\8c\83\93\83X\83f\83B\83\8c\83N\83g\83\8a\81v\82ð\93¾\82é. \82»\82±\82É\83A\83v\83\8a\83P\81[\83V\83\87\83\93\82Í\8cÂ\90l\82Ì\83t\83@\83C\83\8b(\90Ý\92è\82â\83Q\81[\83\80\82Ì\95Û\91\82È\82Ç)\82ð\8f\91\82«\8d\9e\82Þ. \82±\82Ì\83f\83B\83\8c\83N\83g\83\8a\82Í\83\86\81[\83U\82Æ\83A\83v\83\8a\83P\81[\83V\83\87\83\93\82²\82Æ\82É\8cÅ\97L\82Å\82 \82é.
16 <h2>\8d\\95¶</h2>
17 <code>char* SDL_GetPrefPath(const char* org, const char* app)</code>
18 <h2>\88ø\90\94</h2>
19 <table border="1" summary="SDL_GetPrefPath">
20 <tr><td>org</td><td>\91g\90D\96¼</td></tr>
21 <tr><td>app</td><td>\83A\83v\83\8a\83P\81[\83V\83\87\83\93\96¼</td></tr>
22 </table>
23 <h2>\96ß\82è\92l</h2>
24 <p>
25 \8aÂ\8b«\82É\88Ë\91\82µ\82½\8bL\8fq\82Ì\83\86\81[\83U\83f\83B\83\8c\83N\83g\83\8a\82ÌUTF-8\95\8e\9a\97ñ\82ð\96ß\82·. \96â\91è\82ª\82 \82é(\83f\83B\83\8c\83N\83g\83\8a\82Ì\8dì\90¬\82É\8e¸\94s\82È\82Ç)\82Ì\82Æ\82«NULL\82ð\96ß\82·.
26 </p>
27 <h2>\83T\83\93\83v\83\8b\83R\81[\83h</h2>
28 <p>
29 <code>
30 <pre>
31 char *pref_path = NULL;
32
33 void InitializePrefPath() {
34     char *base_path = SDL_GetPrefPath("My Company", "My Awesome SDL 2 Game");
35     if (base_path) {
36         pref_path = base_path;
37     } else {
38         /* \83Q\81[\83\80\82Å\8fî\95ñ\82ð\8f\91\82©\82È\82¢\82æ\82¤\82É\82·\82é\8f\88\97\9d\82ð\82±\82±\82É\8f\91\82­ */
39     }
40 }
41 </pre>
42 </code>
43 </p>
44 <h2>\8fÚ\8d×</h2>
45 <p>
46 \82±\82ê\82Í\83\86\81[\83U\82ª\82Ç\82±\82É\83A\83v\83\8a\83P\81[\83V\83\87\83\93\8cÅ\97L\82Ì\83t\83@\83C\83\8b(\90Ý\92è\82â\83Z\81[\83u\83f\81[\83^\93\99)\82ð\8f\91\82«\8d\9e\82ß\82é\8fê\8f\8a\82ð\95\\82µ\82Ä\82¢\82é.
47 \82±\82Ì\83f\83B\83\8c\83N\83g\83\8a\82Í, \83A\83v\83\8a\83P\81[\83V\83\87\83\93\82²\82Æ, \83\86\81[\83U\82²\82Æ\82É\88Ù\82È\82é.
48 </p>
49 <p>
50 \82±\82Ì\8aÖ\90\94\82Í\83l\83C\83e\83B\83u\82Ì\83t\83@\83C\83\8b\83V\83X\83e\83\80\82É\82Ó\82³\82í\82µ\82¢\8fê\8f\8a\82ð\91I\91ð\82µ, \95K\97v\82È\82ç\82Î\83f\83B\83\8c\83N\83g\83\8a\82ð\90\90¬\82·\82é.
51 \82»\82µ\82Ä, UTF-8\82Ì\90â\91Î\83p\83X\82Ì\95\8e\9a\97ñ\82Å\96ß\82·.
52 </p>
53 <p>
54 Windows\82È\82ç\82Î, \95\8e\9a\97ñ\82Í\8e\9f\82Ì\82æ\82¤\82É\82È\82é: C:\\Users\\bob\\AppData\\Roaming\\My Company\\My Program Name\\
55 </p>
56 <p>
57 Linux\82È\82ç\82Î, \95\8e\9a\97ñ\82Í\8e\9f\82Ì\82æ\82¤\82É\82È\82é: /home/bob/.local/share/My Program Name/
58 </p>
59 <p>
60 macOS\82È\82ç\82Î, \95\8e\9a\97ñ\82Í\8e\9f\82Ì\82æ\82¤\82É\82È\82é: /Users/bob/Library/Application Support/My Program Name/
61 </p>
62 <p>
63 \82±\82Ì\8aÖ\90\94\82ª\96ß\82µ\82½\8fê\8f\8a\82Ì\82Ý\88À\91S\82É\83t\83@\83C\83\8b\82ð\8f\91\82«\8d\9e\82ß\82é\82Æ\82Ý\82È\82·\82×\82«\82Å\82 \82é.
64 (\8f\91\82«\8d\9e\82ß\82é\82Å\82 \82ë\82¤<a href="SDL_GetBasePath.html">SDL_GetBasePath()</a>\82â\82»\82Ì\90e\83f\83B\83\8c\83N\83g\83\8a\82É\82Í\8f\91\82«\8d\9e\82Þ\82×\82«\82Å\82È\82¢.)
65 </p>
66 <p>
67 org\82Æapp\82Í\83f\83B\83\8c\83N\83g\83\8a\82Ì\96¼\91O\82Ì\88ê\95\94\82É\82È\82é. \8e\9f\82Ì\83\8b\81[\83\8b\82É\8f]\82¤\82×\82«\82Å\82 \82é.
68 <ul>
69 <li>\82±\82Ì\8aÖ\90\94\82ð\8eg\82¤\91S\82Ä\82Ì\83A\83v\83\8a\83P\81[\83V\83\87\83\93\82Í, (\91å\95\8e\9a\8f¬\95\8e\9a\82à)\93¯\82¶org\82ð\8eg\82¤.
70 <li>\83A\83v\83\8a\83P\81[\83V\83\87\83\93\82²\82Æ\82É\88á\82¤app\82ð\8eg\82¤. \88ê\93x\8c\88\82ß\82½app\82Í\95Ï\8dX\82µ\82È\82¢.
71 <li>UTF-8\82Å\83G\83\93\83R\81[\83h\82·\82é\8cÀ\82èUnicode\82Í\8eg\82¦\82é. \82µ\82©\82µ...
72 <li>...\8eg\82¤\82Ì\82Í\83A\83\8b\83t\83@\83x\83b\83g, \90\94\8e\9a\8bó\94\92\82Ì\82Ý\82É\82·\82é. "Game Name 2: Bad Guy's Revenge!" \82Ì\82æ\82¤\82É\8bL\8d\86\82ð\8aÜ\82ß\82é\82Ì\82Í\94ð\82¯\82é. "Game Name 2" \82Å\8f\\95ª\82Å\82 \82é.
73 </ul>
74 </p>
75 <p>
76 \83p\83X\96¼\82Ì\96\96\94ö\82É\82Í, \83p\83X\82Ì\8bæ\90Ø\82è\95\8e\9a(Windows\82È\82ç\82Î'\', \91¼\82Ì\8aÂ\8b«\82È\82ç\82Î'/')\82ª\82 \82é\82±\82Æ\82ª\95Û\8fá\82³\82ê\82Ä\82¢\82é.
77 </p>
78 <p>
79 \96ß\82³\82ê\82½\83|\83C\83\93\83^\82Í\83A\83v\83\8a\83P\81[\83V\83\87\83\93\82ª\8aÇ\97\9d\82·\82é\95K\97v\82ª\82 \82é.
80 \8eg\82Á\82½\8cã\82Í\83|\83C\83\93\83^\82É\91Î\82µ\82ÄSDL_free()\82ð\8cÄ\82Ô\82±\82Æ.
81 </p>
82 <h2>\83o\81[\83W\83\87\83\93</h2>
83 SDL 2.0.1\88È\8d~
84 <h2>\8aÖ\98A\8d\80\96Ú(\8aÖ\90\94)</h2>
85 <a href="SDL_GetBasePath.html">SDL_GetBasePath</a><br>
86 <h2>SDL Wiki\82Ö\82Ì\83\8a\83\93\83N</h2>
87 <a href="https://wiki.libsdl.org/SDL_GetPrefPath">SDL_GetPrefPath - SDL Wiki</a>
88 <hr>
89 </body>
90 </html>