java log add function
#dd_traces.pl (C) Marko Kivij?rvi 2006
# Dummy checks
die "Specify an input file!\n" if $ARGV[0] eq "";
die "File not found!\n" unless -e $ARGV[0];
die "Incorrect file extension for a C/C++ file!\n"
if ( $ARGV[0] !~ /(.*)\.(java)$/ );
# Constants
my $IMPORT_LOG_PACKAG = "\nimport android.util.Log;";
my $TAG;
if( $ARGV[0] !~ /BaseAdapter\.java/ && $ARGV[0] !~ /View\.java/) {
$TAG="SWIFTTAG";
}
else {
$TAG="SWIFTBASETAG";
}
# Parse output filename from the input filename
my $file = $ARGV[0];
my $origFile = $1."-orig.".$2;
#system( "cp $file $origFile" );
# Reset the input record separator (newline) so the entire file is read at once
undef $/;
# Read the input file
$_ = <>; # All there
# Adds a tracer macro after each function definition
s/
package #package
\s+
[^{;\/(\s]*\.[^{;\/(\s]* # package name
;
/
AddLogImport(tiny_mce_markeramp;) # Print the match and add the macro
/gxe; # g = repeat, x = split regex to multiple lines, e = evaluate substitution
s/
(public|private|protected)? #api property type
(\s+)?
(abstract)?
(\s+)?
class # Possible function return type
\s+ # One or more empty spaces
(\b\w+?) &n
相关文档:
java(Web)中相对路径,绝对路径问题总结
java中相对路径,绝对路径问题总结
————bohemia(城)
前言:
前一段时间,由于在处理Web应用下的文件创建与移动等,因此涉及到很多关于java
中相对路径,绝对路径等问题。同时,对于Web应用中的 ......
1.
顺序控制
if
else
switch
可以用byte,short,char,int做为表达式类型
循环结构
while
do ...while
for
标签跳转:
outer:
break outer;
outer:
continue outer;
2.数组类型
数组也是一种数据类型,它本身是引用类型。
静态初始化:程序员显示指定初始值,系统决定长度。
动态 ......
在目前的关于java自学的讨论中,最经常看到的就是钻研《Thinking in java》(TIJ)的经验,但是,尽管使用TIJ作为教学材料的教学行为也很多,我却尚未发现有从教师关于如何将TIJ用于教学的论述。为此,我权作抛砖引玉。
首先,为什么要学习java?按照Eckel的话说, ......
Java把内存划分成两种:一种是栈内存,一种是堆内存。
在函数中定义的一些基本类型的变量和对象的引用变量都在函数的栈内存中分配。
当在一段代码块定义一个变量时,Java就在栈中为这个变量分配内存空间,当超过变量的作用域后,Java会自动释放掉为该变量 ......
最近在学习java的时候,对于java函数的传递了解了一下。java的数据类型大的分为两种,一种是基本数据类型,另一种是非基本数据类型,(类数据类型)。在参数传递时候,基本的数据类型传递的是对实参数的一份拷贝,而非基本数据类型则是实例的引用的一份拷贝。我的理解是类的实例,即对象存放的内容就是引用,实际是地址。
......