3 * Copyright 2002-2004 The Ant-Contrib project
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
17 package net
.sf
.antcontrib
.cpptasks
.devstudio
;
19 import java
.util
.Vector
;
21 import net
.sf
.antcontrib
.cpptasks
.compiler
.CommandLineLinker
;
22 import net
.sf
.antcontrib
.cpptasks
.compiler
.LinkType
;
23 import net
.sf
.antcontrib
.cpptasks
.types
.LibraryTypeEnum
;
25 * Abstract base adapter for librarians with command line options compatible
26 * with the Microsoft(r) Library Manager
30 public abstract class DevStudioCompatibleLibrarian
extends CommandLineLinker
{
31 private static String
[] defaultflags
= new String
[]{"/nologo"};
32 public DevStudioCompatibleLibrarian(String command
, String identifierArg
) {
33 super(command
, identifierArg
, new String
[]{".obj"}, new String
[0],
36 protected void addBase(long base
, Vector args
) {
38 protected void addFixed(Boolean fixed
, Vector args
) {
40 protected void addImpliedArgs(boolean debug
, LinkType linkType
,
41 Vector args
, Boolean defaultflag
) {
42 if(defaultflag
!= null && defaultflag
.booleanValue()){
43 for (int i
= 0; i
< defaultflags
.length
; i
++) {
44 args
.addElement(defaultflags
[i
]);
48 protected void addIncremental(boolean incremental
, Vector args
) {
50 protected void addMap(boolean map
, Vector args
) {
52 protected void addStack(int stack
, Vector args
) {
55 * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addEntry(int, java.util.Vector)
57 protected void addEntry(String entry
, Vector args
) {
60 protected String
getCommandFileSwitch(String cmdFile
) {
63 public File
[] getLibraryPath() {
66 public String
[] getLibraryPatterns(String
[] libnames
, LibraryTypeEnum libType
) {
69 public int getMaximumCommandLength() {
72 public String
[] getOutputFileSwitch(String outFile
) {
73 StringBuffer buf
= new StringBuffer("/OUT:");
74 if (outFile
.indexOf(' ') >= 0) {
81 return new String
[]{buf
.toString()};
83 public boolean isCaseSensitive() {