melankolıa18 1
melankolıa18
romegames 1
romegames
Krutzo 1
Krutzo
shrpnl 1
shrpnl
Best Studio 1
Best Studio
D 1
delimuratt
Hikaye Ekle
Reklam vermek için turkmmo@gmail.com

Client Source C++17 yapma

  • Konuyu başlatan Konuyu başlatan mgurbet1998
  • Başlangıç tarihi Başlangıç tarihi
  • Cevaplar Cevaplar 1
  • Görüntüleme Görüntüleme 341
Durum
Üzgünüz bu konu cevaplar için kapatılmıştır...

mgurbet1998

Level 4
Uzman
Katılım
22 Eki 2024
Konular
27
Mesajlar
268
Online süresi
1mo 3d
Reaksiyon Skoru
166
Altın Konu
0
Başarım Puanı
74
MmoLira
2,281
DevLira
42
Ticaret - 0%
0   0   0

ROHAN2 WORLD 1-120 TR TİPİ OFFICIAL YOHARA, BALATHOR VE AMON! 80. GÜNÜNDE! +10.000 ONLİNE! HİLE VE BOT %100 ENGELLİ HEMEN TIKLA!

Anlatım hazırlayacağım devamı gelecek.

[CODE lang="python" title="std::"]import os
import re

def read_file_with_fallback(file_path):
encodings = ['utf-8', 'latin-1', 'cp1252']
for enc in encodings:
try:
with open(file_path, 'r', encoding=enc) as file:
return file.readlines(), enc
except UnicodeDecodeError:
continue
raise UnicodeDecodeError(f"Dosya {file_path} uygun bir şekilde okunamadı.")

def convert_to_std_syntax(file_path):
lines, encoding_used = read_file_with_fallback(file_path)

replacements = [
(r'(?<!std::)(?<!\w)(string)(?!\w)', r'std::string'),
(r'(?<!std::)(?<!\w)(pair)(?!\w)', r'std::pair'),
(r'(?<!std::)(?<!\w)(make_pair)(?!\w)', r'std::make_pair'),
(r'(?<!std::)(?<!\w)(vector)(?!\w)', r'std::vector'),
]

updated_lines = []
for line in lines:
if line.strip().startswith("#include"):
updated_lines.append(line)
continue
for pattern, replacement in replacements:
line = re.sub(pattern, replacement, line)
updated_lines.append(line)

with open(file_path, 'w', encoding=encoding_used) as file:
file.writelines(updated_lines)

def process_directory(directory):
for root, _, files in os.walk(directory):
for file in files:
if file.endswith(('.cpp', '.h')):
file_path = os.path.join(root, file)
print(f"Processing: {file_path}")
try:
convert_to_std_syntax(file_path)
except Exception as e:
print(f"Hata oluştu: {e} (Dosya: {file_path})")

project_directory = "."
process_directory(project_directory)
[/CODE]
 
eksik konudan dolayı kapatıldı konu tamamlandında raporlabilirsiniz
 
Durum
Üzgünüz bu konu cevaplar için kapatılmıştır...

Şu an konuyu görüntüleyenler (Toplam : 0, Üye: 0, Misafir: 0)

Geri
Üst