PlatformUtils.jsm
Go to the documentation of this file.
1 /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set sw=2 :miv */
3 /*
4 //
5 // BEGIN SONGBIRD GPL
6 //
7 // This file is part of the Songbird web player.
8 //
9 // Copyright(c) 2005-2008 POTI, Inc.
10 // http://songbirdnest.com
11 //
12 // This file may be licensed under the terms of of the
13 // GNU General Public License Version 2 (the "GPL").
14 //
15 // Software distributed under the License is distributed
16 // on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
17 // express or implied. See the GPL for the specific language
18 // governing rights and limitations.
19 //
20 // You should have received a copy of the GPL along with this
21 // program. If not, go to http://www.gnu.org/licenses/gpl.html
22 // or write to the Free Software Foundation, Inc.,
23 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 //
25 // END SONGBIRD GPL
26 //
27 */
28 
34 //------------------------------------------------------------------------------
35 //
36 // Platform utility JSM configuration.
37 //
38 //------------------------------------------------------------------------------
39 
40 EXPORTED_SYMBOLS = ["PlatformUtils"];
41 
42 
43 //------------------------------------------------------------------------------
44 //
45 // Platform utility imported services.
46 //
47 //------------------------------------------------------------------------------
48 
49 Components.utils.import("resource://app/jsmodules/SBDataRemoteUtils.jsm");
50 Components.utils.import("resource://app/jsmodules/StringUtils.jsm");
51 
52 
53 //------------------------------------------------------------------------------
54 //
55 // Platform utility defs.
56 //
57 //------------------------------------------------------------------------------
58 
59 const Cc = Components.classes;
60 const Ci = Components.interfaces;
61 const Cr = Components.results
62 
63 var PlatformUtils = {
64  get platformString() {
65  var platform = Cc["@mozilla.org/xre/runtime;1"].
66  getService(Ci.nsIXULRuntime).
67  OS;
68  switch(platform) {
69  case "WINNT":
70  platform = "Windows_NT";
71  break;
72  }
73 
74  return platform;
75  }
76 };
const Cr
const Ci
getService(Ci.sbIFaceplateManager)
const Cc
EXPORTED_SYMBOLS