Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
df53aaf5
Commit
df53aaf5
authored
May 24, 2007
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More c-printf compatible output format implemented
parent
9975b12c
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3118 additions
and
2 deletions
+3118
-2
java/jpwr/jop/src/GeCFormat.java
java/jpwr/jop/src/GeCFormat.java
+25
-2
java/jpwr/jop/src/PrintfFormat.java
java/jpwr/jop/src/PrintfFormat.java
+3092
-0
java/jpwr/jop/src/os_linux/hw_x86/makefile
java/jpwr/jop/src/os_linux/hw_x86/makefile
+1
-0
No files found.
java/jpwr/jop/src/GeCFormat.java
View file @
df53aaf5
/*
* Proview $Id: GeCFormat.java,v 1.
5 2005-09-12 10:48:00
claes Exp $
* Proview $Id: GeCFormat.java,v 1.
6 2007-05-24 12:26:07
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -26,6 +26,7 @@ public class GeCFormat {
int
f_idx
,
p_idx
;
try
{
/*
if ( (f_idx = format.indexOf('f')) != -1) {
format_type = FRM_F;
p_idx = format.indexOf('.');
...
...
@@ -68,7 +69,8 @@ public class GeCFormat {
h = Integer.valueOf(format.substring( 1+no_space, p_idx)).intValue();
}
}
else
if
(
(
f_idx
=
format
.
indexOf
(
'o'
))
!=
-
1
)
{
*/
if
(
(
f_idx
=
format
.
indexOf
(
'o'
))
!=
-
1
)
{
if
(
f_idx
>=
1
&&
format
.
charAt
(
f_idx
-
1
)
==
'1'
)
format_type
=
FRM_1O
;
else
if
(
f_idx
>=
1
&&
format
.
charAt
(
f_idx
-
1
)
==
'2'
)
...
...
@@ -92,6 +94,8 @@ public class GeCFormat {
else
format_type
=
FRM_M
;
}
else
pfo
=
new
PrintfFormat
(
format
);
}
catch
(
NumberFormatException
e
)
{
System
.
out
.
println
(
"NumberFormatException: "
+
format
);
...
...
@@ -102,6 +106,7 @@ public class GeCFormat {
int
h
;
int
no_space
=
0
;
int
format_type
;
PrintfFormat
pfo
;
public
static
final
int
FRM_S
=
0
;
// String
public
static
final
int
FRM_O
=
1
;
// Objid object name
...
...
@@ -121,6 +126,11 @@ public class GeCFormat {
return
format_type
;
}
public
StringBuffer
format
(
float
value
,
StringBuffer
buff
)
{
if
(
pfo
!=
null
)
return
pfo
.
sprintf
(
value
,
buff
);
else
return
buff
;
/*
int j, len;
int t2 = (int) value;
int m;
...
...
@@ -155,9 +165,15 @@ public class GeCFormat {
buff.insert(0," ");
}
return buff;
}
}
public StringBuffer format( int value, StringBuffer buff) {
if ( pfo != null)
return pfo.sprintf( value, buff);
else
return buff;
/*
int j, len;
int t2 = value;
...
...
@@ -170,6 +186,7 @@ public class GeCFormat {
for ( j = 0; j < h-len; j++)
buff.insert(0," ");
return buff;
*/
}
public
StringBuffer
format
(
boolean
value
,
StringBuffer
buff
)
{
...
...
@@ -184,6 +201,11 @@ public class GeCFormat {
public
StringBuffer
format
(
String
value
,
StringBuffer
buff
)
{
switch
(
format_type
)
{
case
FRM_S:
{
if
(
pfo
!=
null
)
return
pfo
.
sprintf
(
value
,
buff
);
else
return
buff
;
/*
int j, len;
if ( h == -1)
...
...
@@ -196,6 +218,7 @@ public class GeCFormat {
for ( j = 0; j < len; j++)
buff.append(value.charAt(j));
return buff;
*/
}
case
FRM_O:
{
int
idx
,
j
,
len
;
...
...
java/jpwr/jop/src/PrintfFormat.java
0 → 100644
View file @
df53aaf5
This diff is collapsed.
Click to expand it.
java/jpwr/jop/src/os_linux/hw_x86/makefile
View file @
df53aaf5
...
...
@@ -3,6 +3,7 @@ include $(pwre_dir_symbols)
local_java_sources
:=
\
JopLog.java
\
Ge.java
\
PrintfFormat.java
\
GeCFormat.java
\
GeDyndata.java
\
GeColor.java
\
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment