35 SetStringBundle(NS_LITERAL_STRING(
"chrome://songbird/locale/songbird.properties"));
37 NS_LITERAL_STRING(
"b"),
38 NS_LITERAL_STRING(
"&storage.unit.bytes"),
39 NS_LITERAL_STRING(
"&storage.unit.bytes.short"),
42 NS_LITERAL_STRING(
"kb"),
43 NS_LITERAL_STRING(
"&storage.unit.kilobytes"),
44 NS_LITERAL_STRING(
"&storage.unit.kilobytes.short"));
46 NS_LITERAL_STRING(
"mb"),
47 NS_LITERAL_STRING(
"&storage.unit.megabytes"),
48 NS_LITERAL_STRING(
"&storage.unit.megabytes.short"));
50 NS_LITERAL_STRING(
"gb"),
51 NS_LITERAL_STRING(
"&storage.unit.gigabytes"),
52 NS_LITERAL_STRING(
"&storage.unit.gigabytes.short"));
54 NS_LITERAL_STRING(
"tb"),
55 NS_LITERAL_STRING(
"&storage.unit.terabytes"),
56 NS_LITERAL_STRING(
"&storage.unit.terabytes.short"));
58 NS_LITERAL_STRING(
"pb"),
59 NS_LITERAL_STRING(
"&storage.unit.petabytes"),
60 NS_LITERAL_STRING(
"&storage.unit.petabytes.short"));
62 NS_LITERAL_STRING(
"eb"),
63 NS_LITERAL_STRING(
"&storage.unit.exabytes"),
64 NS_LITERAL_STRING(
"&storage.unit.exabytes.short"));
86 aValue /= (1024.0*1024.0);
89 aValue /= (1024.0*1024.0*1024.0);
92 aValue /= (1024.0*1024.0*1024.0*1024.0);
95 aValue /= (1024.0*1024.0*1024.0*1024.0*1024.0);
98 aValue /= (1024.0*1024.0*1024.0*1024.0*1024.0*1024.0);
101 return NS_ERROR_INVALID_ARG;
121 aValue *= (1024.0*1024.0);
124 aValue *= (1024.0*1024.0*1024.0);
127 aValue *= (1024.0*1024.0*1024.0*1024.0);
130 aValue *= (1024.0*1024.0*1024.0*1024.0*1024.0);
133 aValue *= (1024.0*1024.0*1024.0*1024.0*1024.0*1024.0);
136 return NS_ERROR_INVALID_ARG;
145 if (aValue == 0) d = 1;
146 else d = (PRUint32)(log10(fabs(aValue)) + 1);
virtual ~sbStoragePropertyUnitConverter()
NS_IMETHOD ConvertFromUnitToNative(PRFloat64 aValue, PRUint32 aUnitID, PRFloat64 &_retVal)
virtual PRInt32 GetAutoUnit(PRFloat64 aValue)
void RegisterUnit(PRUint32 aUnitInternalID, const nsAString &aUnitExternalID, const nsAString &aUnitName, const nsAString &aUnitShortName, PRBool isNative=PR_FALSE)
NS_IMETHOD ConvertFromNativeToUnit(PRFloat64 aValue, PRUint32 aUnitID, PRFloat64 &_retVal)
sbStoragePropertyUnitConverter()
void SetStringBundle(const nsAString &aStringBundle)