This repository has been archived by the owner on Nov 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Allows column sorting - Fixes windows paths - Improved error reporting
- Loading branch information
Showing
12 changed files
with
933 additions
and
827 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0.2 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
0.2 | ||
0.3 | ||
https://github.com/soywiz/vitaorganizer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.2 | ||
0.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,22 @@ | ||
package com.soywiz.vitaorganizer | ||
|
||
object FileSize { | ||
val BYTES = 1L | ||
val KB = 1024 * BYTES | ||
val MB = 1024 * KB | ||
val GB = 1024 * MB | ||
val TB = 1024 * GB | ||
class FileSize(val value: Long) : Comparable<FileSize> { | ||
companion object { | ||
private val BYTES = 1L | ||
private val KB = 1024 * BYTES | ||
private val MB = 1024 * KB | ||
private val GB = 1024 * MB | ||
private val TB = 1024 * GB | ||
|
||
fun toString(size: Long): String { | ||
if (size < KB) return "%.1f B".format(size.toDouble() / BYTES.toDouble()) | ||
if (size < MB) return "%.1f KB".format(size.toDouble() / KB.toDouble()) | ||
if (size < GB) return "%.1f MB".format(size.toDouble() / MB.toDouble()) | ||
if (size < TB) return "%.1f GB".format(size.toDouble() / GB.toDouble()) | ||
return "%.1f TB".format(size.toDouble() / TB.toDouble()) | ||
fun toString(size: Long): String { | ||
if (size < KB) return "%.1f B".format(size.toDouble() / BYTES.toDouble()) | ||
if (size < MB) return "%.1f KB".format(size.toDouble() / KB.toDouble()) | ||
if (size < GB) return "%.1f MB".format(size.toDouble() / MB.toDouble()) | ||
if (size < TB) return "%.1f GB".format(size.toDouble() / GB.toDouble()) | ||
return "%.1f TB".format(size.toDouble() / TB.toDouble()) | ||
} | ||
} | ||
|
||
override fun compareTo(other: FileSize): Int = this.value.compareTo(other.value) | ||
override fun toString() = FileSize.toString(value) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package com.soywiz.vitaorganizer | ||
|
||
interface StatusUpdater { | ||
fun updateStatus(status: String) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.soywiz.vitaorganizer | ||
|
||
import java.util.* | ||
|
||
object Test1 { | ||
@JvmStatic fun main(args: Array<String>) { | ||
PsvitaDevice.setIp("192.168.137.55", 1337) | ||
println(PsvitaDevice.getGameSize("PCSG00683")) | ||
} | ||
} |
Oops, something went wrong.