mirror of
https://git.femboyfinancial.jp/james/lipsync.git
synced 2025-11-28 15:53:44 -08:00
git-svn-id: http://svn.sourceforge.jp/svnroot/lipsync@6 b1f601f4-4f45-0410-8980-aecacb008692
This commit is contained in:
65
trunk/LipSync/DevUtl/DevUtl.csproj
Normal file
65
trunk/LipSync/DevUtl/DevUtl.csproj
Normal file
@@ -0,0 +1,65 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.21022</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{A7798205-28BD-4DCD-A4EC-56FD23EE7AB9}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>DevUtl</RootNamespace>
|
||||
<AssemblyName>DevUtl</AssemblyName>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml.Linq">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data.DataSetExtensions">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Boare.Lib.AppUtil\Boare.Lib.AppUtil.csproj">
|
||||
<Project>{0C58B068-272F-4390-A14F-3D72AFCF3DFB}</Project>
|
||||
<Name>Boare.Lib.AppUtil</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
139
trunk/LipSync/DevUtl/Program.cs
Normal file
139
trunk/LipSync/DevUtl/Program.cs
Normal file
@@ -0,0 +1,139 @@
|
||||
//#define BINARYFILE_TO_BYTEARRAY
|
||||
#define BINARYFILE_TO_BASE64
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
|
||||
using Boare.Lib.AppUtil;
|
||||
|
||||
namespace DevUtl {
|
||||
class Program {
|
||||
static void Main( string[] args ) {
|
||||
#if BINARYFILE_TO_BASE64
|
||||
Console.WriteLine( "BINARYFILE_TO_BASE64" );
|
||||
if ( args.Length < 1 ) {
|
||||
Console.WriteLine( "error; too few arguments" );
|
||||
return;
|
||||
}
|
||||
if ( !File.Exists( args[0] ) ) {
|
||||
Console.WriteLine( "error; file not found" );
|
||||
return;
|
||||
}
|
||||
string str = "";
|
||||
using ( FileStream fs = new FileStream( args[0], FileMode.Open ) ) {
|
||||
byte[] b = new byte[fs.Length];
|
||||
fs.Read( b, 0, b.Length );
|
||||
str = Convert.ToBase64String( b );
|
||||
}
|
||||
int length = str.Length;
|
||||
int split_length = 100;
|
||||
Console.Write( "string foo = " );
|
||||
uint count = 0;
|
||||
while ( length > 0 ) {
|
||||
count++;
|
||||
string pref = " ";
|
||||
if ( count == 1 ) {
|
||||
pref = "";
|
||||
}
|
||||
if ( length < split_length ) {
|
||||
Console.WriteLine( pref + "\"" + str + "\";" );
|
||||
break;
|
||||
} else {
|
||||
string part = str.Substring( 0, split_length );
|
||||
str = str.Substring( split_length );
|
||||
length = str.Length;
|
||||
Console.WriteLine( pref + "\"" + part + "\" +" );
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#if BINARYFILE_TO_BYTEARRAY
|
||||
Console.WriteLine( "BINARYFILE_TO_BYTEARRAY" );
|
||||
if ( args.Length < 2 ) {
|
||||
Console.WriteLine( "error; too few arguments" );
|
||||
return;
|
||||
}
|
||||
if ( !File.Exists( args[0] ) ) {
|
||||
Console.WriteLine( "error; file not found" );
|
||||
return;
|
||||
}
|
||||
byte[] hoge = new byte[] { 0x00, 0x01, };
|
||||
using ( StreamWriter sw = new StreamWriter( args[1], false, Encoding.UTF8 ) ) {
|
||||
sw.Write( "byte[] foo = new byte[] { " );
|
||||
bool first = true;
|
||||
using ( FileStream fs = new FileStream( args[0], FileMode.Open ) ) {
|
||||
const int BUF = 20;
|
||||
byte[] buffer = new byte[BUF];
|
||||
while ( true ) {
|
||||
int len = fs.Read( buffer, 0, BUF );
|
||||
if ( len <= 0 ) {
|
||||
break;
|
||||
}
|
||||
if ( first ) {
|
||||
first = false;
|
||||
} else {
|
||||
sw.WriteLine();
|
||||
sw.Write( " " );
|
||||
}
|
||||
for ( int i = 0; i < len; i++ ) {
|
||||
sw.Write( "0x" + Convert.ToString( buffer[i], 16 ) + ", " );
|
||||
}
|
||||
}
|
||||
}
|
||||
sw.WriteLine( "};" );
|
||||
}
|
||||
#else
|
||||
#if LANGUAGE_FILE_CONVERSION
|
||||
Console.WriteLine( "LANGUAGE_FILE_CONVERSION" );
|
||||
//Console.WriteLine( "input the name of message definition file" );
|
||||
string msg_dat = @"C:\cvs\lipsync\LipSync\en.lang";// Console.ReadLine();
|
||||
Dictionary<string, string> dict = new Dictionary<string, string>();
|
||||
using ( StreamReader sr = new StreamReader( msg_dat ) ) {
|
||||
while ( sr.Peek() >= 0 ) {
|
||||
string line = sr.ReadLine();
|
||||
if ( line.StartsWith( "#" ) ) {
|
||||
continue;
|
||||
}
|
||||
string[] spl = line.Split( "\t".ToCharArray() );
|
||||
dict.Add( spl[0], spl[1] );
|
||||
}
|
||||
}
|
||||
|
||||
while ( true ) {
|
||||
Console.WriteLine( "input edit target file" );
|
||||
string cs = Console.ReadLine();
|
||||
string new_file = Path.Combine( Path.GetDirectoryName( cs ), Path.GetFileNameWithoutExtension( cs ) + "_.tmp" );
|
||||
using ( StreamWriter sw = new StreamWriter( new_file ) )
|
||||
using ( StreamReader sr = new StreamReader( cs ) ) {
|
||||
while ( sr.Peek() >= 0 ) {
|
||||
sw.WriteLine( sr.ReadLine() );
|
||||
}
|
||||
}
|
||||
|
||||
using ( StreamWriter sw = new StreamWriter( cs ) )
|
||||
using ( StreamReader sr = new StreamReader( new_file ) ) {
|
||||
while ( sr.Peek() >= 0 ) {
|
||||
string line = sr.ReadLine();
|
||||
int index = line.IndexOf( "Messaging.GetMessage( MessageID." );
|
||||
if ( index >= 0 ) {
|
||||
while ( index >= 0 ) {
|
||||
int right = line.IndexOf( ")", index );
|
||||
string item = line.Substring( index + 32, right - (index + 32) );
|
||||
item = item.Trim();
|
||||
Console.WriteLine( "item=\"" + item + "\"" );
|
||||
string new_line = line.Substring( 0, index ) + "_( \"" + dict[item] + "\" )" + line.Substring( right + 1 );
|
||||
line = new_line;
|
||||
index = line.IndexOf( "Messaging.GetMessage( MessageID." );
|
||||
}
|
||||
sw.WriteLine( line );
|
||||
} else {
|
||||
sw.WriteLine( line );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
36
trunk/LipSync/DevUtl/Properties/AssemblyInfo.cs
Normal file
36
trunk/LipSync/DevUtl/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// アセンブリに関する一般情報は以下の属性セットをとおして制御されます。
|
||||
// アセンブリに関連付けられている情報を変更するには、
|
||||
// これらの属性値を変更してください。
|
||||
[assembly: AssemblyTitle( "DevUtl" )]
|
||||
[assembly: AssemblyDescription( "" )]
|
||||
[assembly: AssemblyConfiguration( "" )]
|
||||
[assembly: AssemblyCompany( "" )]
|
||||
[assembly: AssemblyProduct( "DevUtl" )]
|
||||
[assembly: AssemblyCopyright( "Copyright © 2008" )]
|
||||
[assembly: AssemblyTrademark( "" )]
|
||||
[assembly: AssemblyCulture( "" )]
|
||||
|
||||
// ComVisible を false に設定すると、その型はこのアセンブリ内で COM コンポーネントから
|
||||
// 参照不可能になります。COM からこのアセンブリ内の型にアクセスする場合は、
|
||||
// その型の ComVisible 属性を true に設定してください。
|
||||
[assembly: ComVisible( false )]
|
||||
|
||||
// 次の GUID は、このプロジェクトが COM に公開される場合の、typelib の ID です
|
||||
[assembly: Guid( "568982bb-45a8-4ebc-bf4f-e3d4d4606b1d" )]
|
||||
|
||||
// アセンブリのバージョン情報は、以下の 4 つの値で構成されています:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を
|
||||
// 既定値にすることができます:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion( "1.0.0.0" )]
|
||||
[assembly: AssemblyFileVersion( "1.0.0.0" )]
|
||||
Reference in New Issue
Block a user